﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Collections;
using System.Xml.Linq;
using System.Windows.Controls.Primitives;
using System.Windows.Media.Imaging;
namespace CricketHub
{
    public partial class PlayerDetails : PhoneApplicationPage
    {
        PlayerDetail obj = new PlayerDetail();

        public PlayerDetails()
        {
            InitializeComponent();
            obj.plydeta = this;
            obj.Request_player();
            playerpbr.Visibility = Visibility.Visible;
        }
        List<Player_Personal_Info> info_player = new List<Player_Personal_Info>();
        List<batting_odi_stats> batting_odi = new List<batting_odi_stats>();
        List<batting_test_stats> batting_test = new List<batting_test_stats>();
        List<batting_t20_stats> batting_t20 = new List<batting_t20_stats>();
        List<battin_ipl_stats> batting_ipl = new List<battin_ipl_stats>();
        List<batting_cl_stats> batting_cl = new List<batting_cl_stats>();

        List<boweling_odi_stats> bowling_odi = new List<boweling_odi_stats>();
        List<bowling_test_stats> bowling_test = new List<bowling_test_stats>();
        List<boweling_t20_stats> bowling_t20 = new List<boweling_t20_stats>();
        List<boweling_ipl_stats> bowling_ipl = new List<boweling_ipl_stats>();
        List<boweling_cl_stats> bowling_cl = new List<boweling_cl_stats>();


        List<career_odi_stats> career_odi = new List<career_odi_stats>();
        List<career_test_stats> career_test = new List<career_test_stats>();
        List<career_t20_stats> career_t20 = new List<career_t20_stats>();
        List<career_ipl_stats> career_ipl = new List<career_ipl_stats>();


        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            career.IsOpen = false;
            personalinfo.IsOpen = false;
            batting.IsOpen = false;
            bowling.IsOpen = false;
            base.OnNavigatedTo(e);
        }
        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            career.IsOpen = false;
            personalinfo.IsOpen = false;
            batting.IsOpen = false;
            bowling.IsOpen = false;
            base.OnNavigatedFrom(e);
        }
        public  void Update_ply_info(string info)
        {
            var element = XElement.Parse(info);
            var personal_info = element.Descendants("personal-information").ElementAt(0);//element.Descendants("player-profile").ElementAt(0);//("personal-information");
            Player_Personal_Info ply_inf = new Player_Personal_Info();
            ply_inf.fullname = personal_info.Element("fullname").Value;
            try
            {
                ply_inf.profile_image = personal_info.Element("profile-image").Value;
            }
            catch (Exception e)
            { 
            }
            ply_inf.majorteam = personal_info.Element("majorteam").Value;
            ply_inf.nickname = personal_info.Element("nickname").Value;
            ply_inf.shortname = personal_info.Element("shortName").Value;
            try
            {
                ply_inf.dateofbirth = personal_info.Element("dateofbirth").Value;
            }
            catch (Exception aa)
            { }
            try
            {
                ply_inf.battingstyle = personal_info.Element("battingstyle").Value;
            }
            catch (Exception ee)
            { 
            }
            ply_inf.bowlingstyle = personal_info.Element("bowlingstyle").Value;
            try
            {
                ply_inf.role = personal_info.Element("role").Value;
            }
            catch (Exception eee)
            { 
            }
            try
            {
                ply_inf.teams_played_for = personal_info.Element("teams-played-for").Value;
            }
            catch (Exception ees)
            { 
            }
            try
            {
                ply_inf.iplteam = personal_info.Element("iplteam").Value;
            }
            catch (Exception ka)
            { }
            info_player.Add(ply_inf);
            System.Diagnostics.Debug.WriteLine("player personal information iss............"+info_player.ElementAt(0).majorteam);



            // career -timeline................

            var career_stats = element.Descendants("career-timeline").ElementAt(0);
            var codi_stats = career_stats.Descendants("odi-career").ElementAt(0);
            career_odi_stats career_stat_od = new career_odi_stats();
            try
            {
                career_stat_od.debuton = codi_stats.Element("debuton").Value;
                career_stat_od.debutagainst = codi_stats.Element("debutagainst").Value;
                career_stat_od.debutat = codi_stats.Element("debutat").Value;
                career_stat_od.lastodiplayedon = codi_stats.Element("lastodiplayedon").Value;
                career_stat_od.lastodiplayedagainst = codi_stats.Element("lastodiplayedagainst").Value;
                career_stat_od.lastodiplayeddat = codi_stats.Element("lastodiplayedat").Value;
            }
            catch (Exception ee)
            {
 
            }
            career_odi.Add(career_stat_od);



            var ctest_stats = career_stats.Descendants("test-career").ElementAt(0);
            career_test_stats career_stat_test = new career_test_stats();
            try
            {
                career_stat_test.debuton = ctest_stats.Element("debuton").Value;

                career_stat_test.debutat = ctest_stats.Element("debutat").Value;
                career_stat_test.lasttestplayedon = ctest_stats.Element("lasttestplayedon").Value;
                career_stat_test.lasttestplayeddat = ctest_stats.Element("lasttestplayedat").Value;
            }
            catch (Exception ee)
            {
 
            }
            try
            {
                career_stat_test.debutagainst = ctest_stats.Element("debutagainst").Value;

                career_stat_test.lasttestplayedagainst = ctest_stats.Element("lasttestplayedagainst").Value;
            }
            catch (Exception test)
            { 
            }
            career_test.Add(career_stat_test);


            var ct20_stats = career_stats.Descendants("t20-career").ElementAt(0);
            career_t20_stats career_stat_t20 = new career_t20_stats();
            try
            {
                career_stat_t20.debuton = ct20_stats.Element("debuton").Value;
                career_stat_t20.debutagainst = ct20_stats.Element("debutagainst").Value;
                career_stat_t20.debutat = ct20_stats.Element("debutat").Value;
                career_stat_t20.lastt20playedon = ct20_stats.Element("lastt20iplayedon").Value;
                career_stat_t20.lastt20playedagainst = ct20_stats.Element("lastt20iplayedagainst").Value;
            }
            catch (Exception aaaa)
            { 
            }
            try
            {
                career_stat_t20.lastt20playeddat = ct20_stats.Element("lastt20iplayedat").Value;
            }
            catch (Exception ee)
            {
 
            }
            career_t20.Add(career_stat_t20);
            career_ipl_stats career_stat_ipl = new career_ipl_stats();
            try
            {
                var cipl_stats = career_stats.Descendants("ipl-career").ElementAt(0);
                
                try
                {
                    career_stat_ipl.debuton = cipl_stats.Element("debuton").Value;

                    career_stat_ipl.debutat = cipl_stats.Element("debutat").Value;
                    career_stat_ipl.debutagainst = cipl_stats.Element("debutagainst").Value;
                }
                catch (Exception eeaaa)
                {
                }
                try
                {
                    career_stat_ipl.lastiplplayedon = cipl_stats.Element("lastiplt20playedon").Value;
                    career_stat_ipl.lastiplplayedagainst = cipl_stats.Element("lastiplplayedagainst").Value;
                    career_stat_ipl.lastiplplayeddat = cipl_stats.Element("lastiplplayedat").Value;
                }
                catch (Exception ghdha)
                {
                }
            }
            catch (Exception ic)
            { 
            }
            career_ipl.Add(career_stat_ipl);









            // bowling stats .........................

            var bowling_stats = element.Descendants("bowling-statistics").ElementAt(0);
            var bodi_stats = bowling_stats.Descendants("odi-stats").ElementAt(0);
            boweling_odi_stats bowling_stat_od = new boweling_odi_stats();
            bowling_stat_od.matchtype = bodi_stats.Element("matchtype").Value;
            bowling_stat_od.matches = bodi_stats.Element("matches").Value;
            try
            {
                bowling_stat_od.innings = bodi_stats.Element("innings").Value;
            }
            catch (Exception pp)
            { 
            }
            bowling_stat_od.ballsbowled = bodi_stats.Element("ballsbowled").Value;
            bowling_stat_od.runsgiven = bodi_stats.Element("runsgiven").Value;
            bowling_stat_od.wickets = bodi_stats.Element("wickets").Value;
            bowling_stat_od.fourwicket = bodi_stats.Element("fourwicket").Value;
            bowling_stat_od.fivewicket = bodi_stats.Element("fivewicket").Value;
            bowling_stat_od.tenwicket = bodi_stats.Element("tenwicket").Value;
            bowling_stat_od.bestbowlinginInnings = bodi_stats.Element("bestbowlingInAnInnings").Value;
            bowling_stat_od.bestbowlinginMatch = bodi_stats.Element("bestbowlingInMatch").Value;
            try
            {
                bowling_stat_od.strikerate = bodi_stats.Element("strikerate").Value;
                bowling_stat_od.economyrate = bodi_stats.Element("economyrate").Value;
                bowling_stat_od.average = bodi_stats.Element("average").Value;

            }
            catch (Exception hga)
            { 
            }
            bowling_odi.Add(bowling_stat_od);


            var btest_stats = bowling_stats.Descendants("test-stats").ElementAt(0);
            bowling_test_stats bowling_stat_test = new bowling_test_stats();
            bowling_stat_test.matchtype = btest_stats.Element("matchtype").Value;
            bowling_stat_test.matches = btest_stats.Element("matches").Value;
            try
            {
                bowling_stat_test.innings = btest_stats.Element("innings").Value;
            }
            catch (Exception om)
            { 
            }
            bowling_stat_test.ballsbowled = btest_stats.Element("ballsbowled").Value;
            bowling_stat_test.runsgiven = btest_stats.Element("runsgiven").Value;
            bowling_stat_test.wickets = btest_stats.Element("wickets").Value;
            bowling_stat_test.fourwicket = btest_stats.Element("fourwicket").Value;
            bowling_stat_test.fivewicket = btest_stats.Element("fivewicket").Value;
            bowling_stat_test.tenwicket = btest_stats.Element("tenwicket").Value;
            bowling_stat_test.bestbowlinginInnings = btest_stats.Element("bestbowlingInAnInnings").Value;
            bowling_stat_test.bestbowlinginMatch = btest_stats.Element("bestbowlingInMatch").Value;
            try
            {
                bowling_stat_test.strikerate = btest_stats.Element("strikerate").Value;
                bowling_stat_test.economyrate = btest_stats.Element("economyrate").Value;
                bowling_stat_test.average = btest_stats.Element("average").Value;
            }
            catch (Exception eee)
            {
 
            }
            


            bowling_test.Add(bowling_stat_test);



            var bt20_stats = bowling_stats.Descendants("t20-stats").ElementAt(0);
            boweling_t20_stats bowling_stat_t20 = new boweling_t20_stats();
            bowling_stat_t20.matchtype = bt20_stats.Element("matchtype").Value;
            bowling_stat_t20.matches = bt20_stats.Element("matches").Value;
            try
            {
                bowling_stat_t20.innings = bt20_stats.Element("innings").Value;
            }
            catch (Exception kaj)
            { 
            }
            bowling_stat_t20.ballsbowled = bt20_stats.Element("ballsbowled").Value;
            bowling_stat_t20.runsgiven = bt20_stats.Element("runsgiven").Value;
            bowling_stat_t20.wickets = bt20_stats.Element("wickets").Value;
            bowling_stat_t20.fourwicket = bt20_stats.Element("fourwicket").Value;
            bowling_stat_t20.fivewicket = bt20_stats.Element("fivewicket").Value;
            bowling_stat_t20.tenwicket = bt20_stats.Element("tenwicket").Value;
            bowling_stat_t20.bestbowlinginInnings = bt20_stats.Element("bestbowlingInAnInnings").Value;
            bowling_stat_t20.bestbowlinginMatch = bt20_stats.Element("bestbowlingInMatch").Value;
            try
            {
                bowling_stat_t20.strikerate = bt20_stats.Element("strikerate").Value;
                bowling_stat_t20.economyrate = bt20_stats.Element("economyrate").Value;
                bowling_stat_t20.average = bt20_stats.Element("average").Value;
            }
            catch (Exception eeaa)
            { 
            }


            bowling_t20.Add(bowling_stat_t20);

            boweling_ipl_stats bowling_stat_ipl = new boweling_ipl_stats();
            try
            {
                var bipl_stats = bowling_stats.Descendants("ipl-stats").ElementAt(0);
                
                bowling_stat_ipl.matchtype = bipl_stats.Element("matchtype").Value;
                bowling_stat_ipl.matches = bipl_stats.Element("matches").Value;
                bowling_stat_ipl.innings = bipl_stats.Element("innings").Value;
                bowling_stat_ipl.ballsbowled = bipl_stats.Element("ballsbowled").Value;
                bowling_stat_ipl.runsgiven = bipl_stats.Element("runsgiven").Value;
                bowling_stat_ipl.wickets = bipl_stats.Element("wickets").Value;
                bowling_stat_ipl.fourwicket = bipl_stats.Element("fourwicket").Value;
                bowling_stat_ipl.fivewicket = bipl_stats.Element("fivewicket").Value;
                bowling_stat_ipl.tenwicket = bipl_stats.Element("tenwicket").Value;
                bowling_stat_ipl.bestbowlinginInnings = bipl_stats.Element("bestbowlingInAnInnings").Value;
                bowling_stat_ipl.bestbowlinginMatch = bipl_stats.Element("bestbowlingInMatch").Value;
                try
                {
                    bowling_stat_ipl.economyrate = bipl_stats.Element("economyrate").Value;
                    bowling_stat_ipl.strikerate = bipl_stats.Element("strikerate").Value;
                    bowling_stat_ipl.average = bipl_stats.Element("average").Value;
                }
                catch (Exception eee)
                {
                }
            }
            catch (Exception kkk)
            { 
            }
            
           


            bowling_ipl.Add(bowling_stat_ipl);

            boweling_cl_stats bowling_stat_cl = new boweling_cl_stats();
            try
            {

                var bcl_stats = bowling_stats.Descendants("cl-stats").ElementAt(0);
               
                bowling_stat_cl.matchtype = bcl_stats.Element("matchtype").Value;
                bowling_stat_cl.matches = bcl_stats.Element("matches").Value;
                bowling_stat_cl.innings = bcl_stats.Element("innings").Value;
                bowling_stat_cl.ballsbowled = bcl_stats.Element("ballsbowled").Value;
                bowling_stat_cl.runsgiven = bcl_stats.Element("runsgiven").Value;
                bowling_stat_cl.wickets = bcl_stats.Element("wickets").Value;
                bowling_stat_cl.fourwicket = bcl_stats.Element("fourwicket").Value;
                bowling_stat_cl.fivewicket = bcl_stats.Element("fivewicket").Value;
                bowling_stat_cl.tenwicket = bcl_stats.Element("tenwicket").Value;
                bowling_stat_cl.bestbowlinginInnings = bcl_stats.Element("bestbowlingInAnInnings").Value;
                bowling_stat_cl.bestbowlinginMatch = bcl_stats.Element("bestbowlingInMatch").Value;
           
            try
            {
                bowling_stat_cl.strikerate = bcl_stats.Element("strikerate").Value;
                bowling_stat_cl.average = bcl_stats.Element("average").Value;
                bowling_stat_cl.economyrate = bcl_stats.Element("economyrate").Value;
            }
            catch (Exception aaa)
            {
 
            }

            }
            catch (Exception cl)
            {
            }
            


            bowling_cl.Add(bowling_stat_cl);






            var batting_stats = element.Descendants("batting-statistics").ElementAt(0);
            var odi_stats = batting_stats.Descendants("odi-stats").ElementAt(0);
            System.Diagnostics.Debug.WriteLine("batting odi.......values" + odi_stats);
            batting_odi_stats batting_stat_od = new batting_odi_stats();
            batting_stat_od.matchtype = odi_stats.Element("matchtype").Value;
            batting_stat_od.matches = odi_stats.Element("matches").Value;
            batting_stat_od.innings = odi_stats.Element("innings").Value;
            batting_stat_od.notouts = odi_stats.Element("notouts").Value;
            batting_stat_od.runsscored = odi_stats.Element("runsscored").Value;
            batting_stat_od.highestscore = odi_stats.Element("highestscore").Value;
            batting_stat_od.ballstaken = odi_stats.Element("ballstaken").Value;
            batting_stat_od.sixes = odi_stats.Element("sixes").Value;
            batting_stat_od.fours = odi_stats.Element("fours").Value;
            batting_stat_od.ducks = odi_stats.Element("ducks").Value;
            batting_stat_od.fiffties = odi_stats.Element("fifties").Value;
            batting_stat_od.catches = odi_stats.Element("catches").Value;
            batting_stat_od.stumpings = odi_stats.Element("stumpings").Value;
            batting_stat_od.hundreds = odi_stats.Element("hundreds").Value;
            try
            {
                batting_stat_od.average = odi_stats.Element("average").Value;
            }
            catch (Exception hall)
            { 
            }
            batting_odi.Add(batting_stat_od);
            System.Diagnostics.Debug.WriteLine("battin odi stats....sixes.............." + batting_stat_od.sixes);
            var test_stats = batting_stats.Descendants("test-stats").ElementAt(0);
            System.Diagnostics.Debug.WriteLine(test_stats);
            batting_test_stats batting_stat_test = new batting_test_stats();
            batting_stat_test.matchtype = test_stats.Element("matchtype").Value;
            batting_stat_test.matches = test_stats.Element("matches").Value;
            batting_stat_test.innings = test_stats.Element("innings").Value;
            batting_stat_test.notouts = test_stats.Element("notouts").Value;
            batting_stat_test.runsscored = test_stats.Element("runsscored").Value;
            batting_stat_test.highestscore = test_stats.Element("highestscore").Value;
            batting_stat_test.ballstaken = test_stats.Element("ballstaken").Value;
            batting_stat_test.sixes = test_stats.Element("sixes").Value;
            batting_stat_test.fours = test_stats.Element("fours").Value;
            batting_stat_test.ducks = test_stats.Element("ducks").Value;
            batting_stat_test.fiffties = test_stats.Element("fifties").Value;
            batting_stat_test.catches = test_stats.Element("catches").Value;
            batting_stat_test.stumpings = test_stats.Element("stumpings").Value;
            batting_stat_test.hundreds = test_stats.Element("hundreds").Value;
            try
            {
                batting_stat_test.average = test_stats.Element("average").Value;
            }
            catch (Exception hll)
            { 
            }
            batting_test.Add(batting_stat_test);
            System.Diagnostics.Debug.WriteLine("testin data for thissssssssssssss" + batting_stat_test.average);


            var t20_stats = batting_stats.Descendants("t20-stats").ElementAt(0);
            System.Diagnostics.Debug.WriteLine(t20_stats);
            batting_t20_stats batting_stat_t20 = new batting_t20_stats();

            batting_stat_t20.matchtype = t20_stats.Element("matchtype").Value;
            batting_stat_t20.matches = t20_stats.Element("matches").Value;
            batting_stat_t20.innings = t20_stats.Element("innings").Value;
            batting_stat_t20.notouts = t20_stats.Element("notouts").Value;
            batting_stat_t20.runsscored = t20_stats.Element("runsscored").Value;
            batting_stat_t20.highestscore = t20_stats.Element("highestscore").Value;
            batting_stat_t20.ballstaken = t20_stats.Element("ballstaken").Value;
            batting_stat_t20.sixes = t20_stats.Element("sixes").Value;
            batting_stat_t20.fours = t20_stats.Element("fours").Value;
            batting_stat_t20.ducks = t20_stats.Element("ducks").Value;
            batting_stat_t20.fiffties = t20_stats.Element("fifties").Value;
            batting_stat_t20.catches = t20_stats.Element("catches").Value;
            batting_stat_t20.stumpings = t20_stats.Element("stumpings").Value;
            batting_stat_t20.hundreds = t20_stats.Element("hundreds").Value;
            try
            {
                batting_stat_t20.average = t20_stats.Element("average").Value;
            }
            catch (Exception bn)
            {
 
            }
            batting_t20.Add(batting_stat_t20);
            System.Diagnostics.Debug.WriteLine("t20 statu valuessssssssssssssssssss" + batting_stat_t20.matchtype+"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");

            battin_ipl_stats batting_stat_ipl = new battin_ipl_stats();
            try
            {
                var ipl_stats = batting_stats.Descendants("ipl-stats").ElementAt(0);
                System.Diagnostics.Debug.WriteLine(ipl_stats);
                

                batting_stat_ipl.matchtype = ipl_stats.Element("matchtype").Value;
                batting_stat_ipl.matches = ipl_stats.Element("matches").Value;
                batting_stat_ipl.innings = ipl_stats.Element("innings").Value;
                batting_stat_ipl.notouts = ipl_stats.Element("notouts").Value;
                batting_stat_ipl.runsscored = ipl_stats.Element("runsscored").Value;
                batting_stat_ipl.highestscore = ipl_stats.Element("highestscore").Value;
                batting_stat_ipl.ballstaken = ipl_stats.Element("ballstaken").Value;
                batting_stat_ipl.sixes = ipl_stats.Element("sixes").Value;
                batting_stat_ipl.fours = ipl_stats.Element("fours").Value;
                batting_stat_ipl.ducks = ipl_stats.Element("ducks").Value;
                batting_stat_ipl.fiffties = ipl_stats.Element("fifties").Value;
                batting_stat_ipl.catches = ipl_stats.Element("catches").Value;
                batting_stat_ipl.stumpings = ipl_stats.Element("stumpings").Value;
                batting_stat_ipl.hundreds = ipl_stats.Element("hundreds").Value;
                try
                {
                    batting_stat_ipl.average = ipl_stats.Element("average").Value;
                }
                catch (Exception we)
                {
                }
            }
            catch (Exception aa)
            { }
            batting_ipl.Add(batting_stat_ipl);
            System.Diagnostics.Debug.WriteLine("ipl statu valuessssssssssssssssssss" + batting_stat_ipl.stumpings);




            try
            {
                var cl_stats = batting_stats.Descendants("cl-stats").ElementAt(0);


                System.Diagnostics.Debug.WriteLine(cl_stats);
                batting_cl_stats batting_stat_cl = new batting_cl_stats();

                batting_stat_cl.matchtype = cl_stats.Element("matchtype").Value;
                batting_stat_cl.matches = cl_stats.Element("matches").Value;
                batting_stat_cl.innings = cl_stats.Element("innings").Value;
                batting_stat_cl.notouts = cl_stats.Element("notouts").Value;
                batting_stat_cl.runsscored = cl_stats.Element("runsscored").Value;
                batting_stat_cl.highestscore = cl_stats.Element("highestscore").Value;
                batting_stat_cl.ballstaken = cl_stats.Element("ballstaken").Value;
                batting_stat_cl.sixes = cl_stats.Element("sixes").Value;
                batting_stat_cl.fours = cl_stats.Element("fours").Value;
                batting_stat_cl.ducks = cl_stats.Element("ducks").Value;
                batting_stat_cl.fiffties = cl_stats.Element("fifties").Value;
                batting_stat_cl.catches = cl_stats.Element("catches").Value;
                batting_stat_cl.stumpings = cl_stats.Element("stumpings").Value;
                batting_stat_cl.hundreds = cl_stats.Element("hundreds").Value;
                batting_stat_cl.average = cl_stats.Element("average").Value;
                batting_cl.Add(batting_stat_cl);
                System.Diagnostics.Debug.WriteLine("cl0 statu valuessssssssssssssssssss" + batting_stat_cl.stumpings);
            }
            catch (Exception soo)
            {
 
            }



            Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    playerpbr.Visibility = Visibility.Collapsed;




                    try
                    {
                        button2.Background = new SolidColorBrush(Colors.Black);
                        button3.Background = new SolidColorBrush(Colors.Black);
                        button4.Background = new SolidColorBrush(Colors.Black);
                        button1.Background = new SolidColorBrush(Colors.Brown);
                        personalinfo.IsOpen = true;
                        bowling.IsOpen = false;
                        batting.IsOpen = false;
                        career.IsOpen = false;
                        Border br_pers = new Border();
                        br_pers.BorderThickness = new Thickness(3.0);
                        br_pers.Margin = new Thickness(20, 200, 0, 0);
                        StackPanel stk_personal_info = new StackPanel();
                        stk_personal_info.Height = 500;
                        stk_personal_info.Width = 450;
                        TextBlock fullname = new TextBlock();
                        fullname.Text = info_player.ElementAt(0).fullname;
                        fullname.FontSize = 28;
                        fullname.TextWrapping = TextWrapping.Wrap;
                        fullname.Foreground = new SolidColorBrush(Colors.Black);
                        fullname.Margin = new Thickness(150, -30, 0, 0);
                        fullname.HorizontalAlignment = HorizontalAlignment.Left;
                        TextBlock fullname_content = new TextBlock();
                        fullname_content.Text = "PLAYER NAME";
                        fullname_content.FontSize = 22;
                        fullname_content.HorizontalAlignment = HorizontalAlignment.Left;
                        fullname_content.Foreground = new SolidColorBrush(Colors.Blue);
                        Image img = new Image();
                        try
                        {
                            img.Source = new BitmapImage(new Uri(info_player.ElementAt(0).profile_image));
                        }
                        catch (Exception imag)
                        {
                        }
                        img.Height = 200;
                        img.Width = 200;
                        img.Margin = new Thickness(300, 0, 0, 0);
                        img.HorizontalAlignment = HorizontalAlignment.Center;
                        TextBlock team = new TextBlock();
                        team.Text = info_player.ElementAt(0).majorteam;
                        team.FontSize = 24;
                        team.Margin = new Thickness(150, -176, 0, 0);
                        team.Foreground = new SolidColorBrush(Colors.Black);
                        team.HorizontalAlignment = HorizontalAlignment.Left;
                        TextBlock team_content = new TextBlock();
                        team_content.Text = "TEAM    ";
                        team_content.FontSize = 24;
                        team_content.Margin = new Thickness(0, -180, 0, 0);
                        team_content.Foreground = new SolidColorBrush(Colors.Blue);
                        team_content.HorizontalAlignment = HorizontalAlignment.Left;
                        TextBlock nickname = new TextBlock();
                        nickname.Text = info_player.ElementAt(0).nickname;
                        nickname.FontSize = 24;
                        nickname.TextWrapping = TextWrapping.Wrap;
                        nickname.Foreground = new SolidColorBrush(Colors.Black);
                        nickname.HorizontalAlignment = HorizontalAlignment.Left;
                        nickname.Margin = new Thickness(150, -130, 0, 0);
                        TextBlock nickname_content = new TextBlock();
                        nickname_content.Text = "NICKNAME ";
                        nickname_content.FontSize = 24;
                        nickname_content.Foreground = new SolidColorBrush(Colors.Blue);
                        nickname_content.HorizontalAlignment = HorizontalAlignment.Left;
                        nickname_content.Margin = new Thickness(0, -130, 0, 0);
                        TextBlock shortname = new TextBlock();
                        shortname.Text = info_player.ElementAt(0).shortname;
                        shortname.FontSize = 34;
                        shortname.Foreground = new SolidColorBrush(Colors.Black);
                        shortname.HorizontalAlignment = HorizontalAlignment.Center;
                        shortname.Margin = new Thickness(0, -80, 0, 0);
                        TextBlock shortname_content = new TextBlock();
                        shortname_content.Text = "SHORT NAME ";
                        shortname_content.FontSize = 24;
                        shortname_content.Foreground = new SolidColorBrush(Colors.Blue);
                        shortname_content.HorizontalAlignment = HorizontalAlignment.Left;
                        shortname_content.Margin = new Thickness(0, -80, 0, 0);
                        TextBlock dateofbi = new TextBlock();
                        dateofbi.Text = info_player.ElementAt(0).dateofbirth;
                        dateofbi.FontSize = 24;
                        dateofbi.Foreground = new SolidColorBrush(Colors.Black);
                        dateofbi.HorizontalAlignment = HorizontalAlignment.Left;
                        dateofbi.Margin = new Thickness(150, -65, 0, 0);
                        TextBlock date_content = new TextBlock();
                        date_content.Text = "D.O.B   ";
                        date_content.FontSize = 24;
                        date_content.Foreground = new SolidColorBrush(Colors.Blue);
                        date_content.HorizontalAlignment = HorizontalAlignment.Left;
                        date_content.Margin = new Thickness(0, -65, 0, 0);
                        TextBlock battingstyle = new TextBlock();
                        battingstyle.Text = info_player.ElementAt(0).battingstyle;
                        battingstyle.FontSize = 24;
                        battingstyle.Foreground = new SolidColorBrush(Colors.Black);
                        battingstyle.HorizontalAlignment = HorizontalAlignment.Left;
                        battingstyle.Margin = new Thickness(190, -30, 0, 0);
                        TextBlock battingstyle_content = new TextBlock();
                        battingstyle_content.Text = "BATTING STYLE ";
                        battingstyle_content.FontSize = 24;
                        battingstyle_content.Foreground = new SolidColorBrush(Colors.Blue);
                        battingstyle_content.HorizontalAlignment = HorizontalAlignment.Left;
                        battingstyle_content.Margin = new Thickness(0, 10, 0, 0);
                        TextBlock bowling1 = new TextBlock();
                        bowling1.Text = info_player.ElementAt(0).bowlingstyle;
                        bowling1.FontSize = 24;
                        bowling1.Foreground = new SolidColorBrush(Colors.Black);
                        bowling1.HorizontalAlignment = HorizontalAlignment.Left;
                        bowling1.Margin = new Thickness(190, -30, 0, 0);
                        TextBlock bowling_content = new TextBlock();
                        bowling_content.Text = "BOWLING STYLE ";
                        bowling_content.FontSize = 24;
                        bowling_content.Foreground = new SolidColorBrush(Colors.Blue);
                        bowling_content.Margin = new Thickness(0, 20, 0, 0);
                        bowling_content.HorizontalAlignment = HorizontalAlignment.Left;

                        TextBlock role = new TextBlock();
                        role.Text = info_player.ElementAt(0).role;
                        role.FontSize = 24;
                        role.Foreground = new SolidColorBrush(Colors.Black);
                        role.HorizontalAlignment = HorizontalAlignment.Left;
                        role.Margin = new Thickness(190, -30, 0, 0);
                        TextBlock role_content = new TextBlock();
                        role_content.Text = "ROLE  ";
                        role_content.FontSize = 24;
                        role_content.Foreground = new SolidColorBrush(Colors.Blue);
                        role_content.Margin = new Thickness(0, 20, 0, 0);
                        role_content.HorizontalAlignment = HorizontalAlignment.Left;



                        TextBlock teams_played = new TextBlock();
                        teams_played.Text = info_player.ElementAt(0).teams_played_for;
                        teams_played.FontSize = 24;
                        teams_played.Foreground = new SolidColorBrush(Colors.Black);
                        teams_played.HorizontalAlignment = HorizontalAlignment.Left;
                        teams_played.Margin = new Thickness(190, -30, 0, 0);
                        teams_played.TextWrapping = TextWrapping.Wrap;
                        // teams_played.Width = 250;
                        TextBlock teams_played_content = new TextBlock();
                        teams_played_content.Text = "TEAMS PLAYED ";
                        teams_played_content.FontSize = 24;
                        teams_played_content.TextWrapping = TextWrapping.Wrap;
                        teams_played_content.Foreground = new SolidColorBrush(Colors.Blue);
                        teams_played_content.Margin = new Thickness(0, 20, 0, 0);
                        teams_played_content.HorizontalAlignment = HorizontalAlignment.Left;



                        stk_personal_info.Children.Add(fullname_content);
                        stk_personal_info.Children.Add(fullname);
                        stk_personal_info.Children.Add(img);
                        stk_personal_info.Children.Add(team_content);
                        stk_personal_info.Children.Add(team);
                        stk_personal_info.Children.Add(nickname_content);
                        stk_personal_info.Children.Add(nickname);
                        // stk_personal_info.Children.Add(shortname_content);
                        // stk_personal_info.Children.Add(shortname);
                        stk_personal_info.Children.Add(date_content);
                        stk_personal_info.Children.Add(dateofbi);
                        stk_personal_info.Children.Add(battingstyle_content);
                        stk_personal_info.Children.Add(battingstyle);
                        stk_personal_info.Children.Add(bowling_content);
                        stk_personal_info.Children.Add(bowling1);
                        stk_personal_info.Children.Add(role_content);
                        stk_personal_info.Children.Add(role);
                        stk_personal_info.Children.Add(teams_played_content);
                        stk_personal_info.Children.Add(teams_played);
                        br_pers.Child = stk_personal_info;
                        personalinfo.Child = br_pers;


                    }
                    catch (Exception aa)
                    {
                        MessageBox.Show("Please wait it is Loading and try again");
                    }








                });

 
        }

        Popup batting = new Popup();
        Border br = new Border();
        ListBox items = new ListBox();
        
       
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                button2.Background = new SolidColorBrush(Colors.Brown);
                button3.Background = new SolidColorBrush(Colors.Black);
                button4.Background = new SolidColorBrush(Colors.Black);
                button1.Background = new SolidColorBrush(Colors.Black);

                bowling.IsOpen = false;
                personalinfo.IsOpen = false;

                career.IsOpen = false;
                ListBox items = new ListBox();
                // Border br = new Border();
                br.BorderThickness = new Thickness(3.0);
                br.BorderBrush = new SolidColorBrush(Colors.Green);
                br.Margin = new Thickness(20, 200, 0, 0);
                StackPanel stk = new StackPanel();
                stk.Height = 580;
                stk.Width = 440;
                // stk.Background = new SolidColorBrush(Colors.LightGray);
                Button btn_od = new Button();
                btn_od.Content = "ODI";
                btn_od.Name = "btn_odi";
                btn_od.Height = 80;
                btn_od.Width = 100;
                btn_od.Margin = new Thickness(0, 0, 0, 0);
                btn_od.BorderThickness = new Thickness(0);
                btn_od.Background = new SolidColorBrush(Colors.DarkGray);
                btn_od.Click += new RoutedEventHandler(btn_od_Click);
                btn_od.HorizontalAlignment = HorizontalAlignment.Left;
                Button btn_test = new Button();
                btn_test.Content = "TEST";
                btn_test.Name = "btn_test";
                btn_test.Height = 80;
                btn_test.Width = 100;
                btn_test.HorizontalAlignment = HorizontalAlignment.Center;
                btn_test.BorderThickness = new Thickness(0);
                btn_test.Background = new SolidColorBrush(Colors.Brown);
                btn_test.Margin = new Thickness(-175, -80, 0, 0);
                btn_test.Click += new RoutedEventHandler(btn_test_Click);
                Button btn_ipl = new Button();
                btn_ipl.Content = "IPL";
                btn_ipl.Name = "btn_ipl";
                btn_ipl.Height = 80;
                btn_ipl.Width = 100;
                btn_ipl.HorizontalAlignment = HorizontalAlignment.Center;
                btn_ipl.BorderThickness = new Thickness(0);
                btn_ipl.Background = new SolidColorBrush(Colors.Brown);
                btn_ipl.Margin = new Thickness(15, -80, 0, 0);
                btn_ipl.Click += new RoutedEventHandler(btn_ipl_Click);
                Button btn_t20 = new Button();
                btn_t20.Content = "T20";
                btn_t20.Name = "btn_t20";
                btn_t20.Height = 80;
                btn_t20.Width = 100;
                btn_t20.BorderThickness = new Thickness(0);
                btn_t20.Background = new SolidColorBrush(Colors.Brown);
                btn_t20.HorizontalAlignment = HorizontalAlignment.Center;
                btn_t20.Margin = new Thickness(200, -80, 0, 0);
                btn_t20.Click += new RoutedEventHandler(btn_t20_Click);
                Button btn_cl = new Button();
                btn_cl.Content = "CL";
                btn_cl.Name = "btn_cl";
                btn_cl.Height = 80;
                btn_cl.Width = 90;
                btn_cl.HorizontalAlignment = HorizontalAlignment.Right;
                btn_cl.Margin = new Thickness(10, -80, 0, 0);
                btn_cl.BorderThickness = new Thickness(0);
                btn_cl.Background = new SolidColorBrush(Colors.Brown);
                btn_cl.Click += new RoutedEventHandler(btn_cl_Click);
                stk.Children.Add(btn_od);
                stk.Children.Add(btn_test);
                stk.Children.Add(btn_ipl);
                stk.Children.Add(btn_t20);
                stk.Children.Add(btn_cl);
                items.Height = 480;
                items.Width = 400;


                TextBlock matches = new TextBlock();
                matches.Text = batting_odi.ElementAt(0).matches;
                matches.FontSize = 24;
                matches.HorizontalAlignment = HorizontalAlignment.Right;
                matches.Foreground = new SolidColorBrush(Colors.Red);
                matches.Margin = new Thickness(280, -30, 0, 0);
                TextBlock matches_content = new TextBlock();
                matches_content.Text = "MATCHES";
                matches_content.FontSize = 24;
                matches_content.Foreground = new SolidColorBrush(Colors.Red);
                matches_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_match = new StackPanel();
                stk_match.Height = 50;
                stk_match.Children.Add(matches_content);
                stk_match.Children.Add(matches);


                TextBlock innings = new TextBlock();
                innings.Text = batting_odi.ElementAt(0).innings;
                innings.FontSize = 24;
                innings.HorizontalAlignment = HorizontalAlignment.Right;
                innings.Foreground = new SolidColorBrush(Colors.Black);
                innings.Margin = new Thickness(280, -30, 0, 0);
                TextBlock innings_content = new TextBlock();
                innings_content.Text = "INNINGS";
                innings_content.FontSize = 24;
                innings_content.Foreground = new SolidColorBrush(Colors.Black);
                innings_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_inn = new StackPanel();
                stk_inn.Height = 50;
                stk_inn.Children.Add(innings_content);
                stk_inn.Children.Add(innings);

                TextBlock matchtype = new TextBlock();
                matchtype.Text = batting_odi.ElementAt(0).matchtype;
                matchtype.FontSize = 24;
                matchtype.HorizontalAlignment = HorizontalAlignment.Right;
                matchtype.Foreground = new SolidColorBrush(Colors.Blue);
                matchtype.Margin = new Thickness(280, -30, 0, 0);
                TextBlock matchtype_content = new TextBlock();
                matchtype_content.Text = "MATCH TYPE";
                matchtype_content.FontSize = 24;
                matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
                matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
                StackPanel stk_matchtype = new StackPanel();
                stk_matchtype.Height = 50;
                stk_matchtype.Children.Add(matchtype_content);
                stk_matchtype.Children.Add(matchtype);

                TextBlock notout = new TextBlock();
                notout.Text = batting_odi.ElementAt(0).notouts;
                notout.FontSize = 24;
                notout.HorizontalAlignment = HorizontalAlignment.Right;
                notout.Foreground = new SolidColorBrush(Colors.Blue);

                notout.Margin = new Thickness(280, -30, 0, 0);
                TextBlock notout_content = new TextBlock();
                notout_content.Text = "NOT OUT";
                notout_content.FontSize = 24;
                notout_content.Foreground = new SolidColorBrush(Colors.Blue);
                notout_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_not = new StackPanel();
                stk_not.Height = 50;
                stk_not.Children.Add(notout_content);
                stk_not.Children.Add(notout);



                TextBlock runsscored = new TextBlock();
                runsscored.Text = batting_odi.ElementAt(0).runsscored;
                runsscored.FontSize = 24;
                runsscored.HorizontalAlignment = HorizontalAlignment.Right;
                runsscored.Foreground = new SolidColorBrush(Colors.Brown);
                runsscored.Margin = new Thickness(280, -30, 0, 0);

                TextBlock runsscored_content = new TextBlock();
                runsscored_content.Text = "RUNS SCORED";
                runsscored_content.FontSize = 24;
                runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
                runsscored_content.Foreground = new SolidColorBrush(Colors.Brown);
                StackPanel stk_runs = new StackPanel();
                stk_runs.Height = 50;

                stk_runs.Children.Add(runsscored_content);
                stk_runs.Children.Add(runsscored);


                TextBlock highestscore = new TextBlock();
                highestscore.Text = batting_odi.ElementAt(0).highestscore;
                highestscore.FontSize = 24;
                highestscore.Margin = new Thickness(280, -30, 0, 0);
                highestscore.HorizontalAlignment = HorizontalAlignment.Right;
                highestscore.Foreground = new SolidColorBrush(Colors.Purple);

                TextBlock highestscore_content = new TextBlock();
                highestscore_content.Text = "HIGHEST SCORE";
                highestscore_content.FontSize = 24;
                highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
                highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
                StackPanel stk_high = new StackPanel();
                stk_high.Height = 50;

                stk_high.Children.Add(highestscore_content);
                stk_high.Children.Add(highestscore);



                TextBlock ballstaken = new TextBlock();
                ballstaken.Text = batting_odi.ElementAt(0).ballstaken;
                ballstaken.FontSize = 24;
                ballstaken.Foreground = new SolidColorBrush(Colors.Brown);
                ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
                ballstaken.Margin = new Thickness(280, -30, 0, 0);
                TextBlock ballstaken_content = new TextBlock();
                ballstaken_content.Text = "BALLS TAKEN";
                ballstaken_content.FontSize = 24;
                ballstaken_content.Foreground = new SolidColorBrush(Colors.Brown);
                ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_balls = new StackPanel();
                stk_balls.Height = 50;
                stk_balls.Children.Add(ballstaken_content);
                stk_balls.Children.Add(ballstaken);





                TextBlock sixes = new TextBlock();
                sixes.Text = batting_odi.ElementAt(0).sixes;
                sixes.FontSize = 24;
                sixes.Foreground = new SolidColorBrush(Colors.Blue);
                sixes.HorizontalAlignment = HorizontalAlignment.Right;
                sixes.Margin = new Thickness(280, -30, 0, 0);
                TextBlock sixes_content = new TextBlock();
                sixes_content.Text = "6'S";
                sixes_content.FontSize = 24;
                sixes_content.Foreground = new SolidColorBrush(Colors.Blue);
                sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_six = new StackPanel();
                stk_six.Height = 50;
                stk_six.Children.Add(sixes_content);
                stk_six.Children.Add(sixes);


                TextBlock fours = new TextBlock();
                fours.Text = batting_odi.ElementAt(0).fours;
                fours.Foreground = new SolidColorBrush(Colors.Brown);
                fours.HorizontalAlignment = HorizontalAlignment.Right;
                fours.FontSize = 24;
                fours.Margin = new Thickness(280, -30, 0, 0);
                TextBlock fours_content = new TextBlock();
                fours_content.Text = "4'S";
                fours_content.FontSize = 24;
                fours_content.Foreground = new SolidColorBrush(Colors.Brown);
                fours_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_four = new StackPanel();
                stk_four.Height = 50;
                stk_four.Children.Add(fours_content);
                stk_four.Children.Add(fours);


                TextBlock ducks = new TextBlock();
                ducks.Text = batting_odi.ElementAt(0).ducks;
                ducks.FontSize = 24;
                ducks.Foreground = new SolidColorBrush(Colors.Red);
                ducks.HorizontalAlignment = HorizontalAlignment.Right;
                ducks.Margin = new Thickness(280, -30, 0, 0);
                TextBlock ducks_content = new TextBlock();
                ducks_content.Text = "DUCKS";
                ducks_content.FontSize = 24;
                ducks_content.Foreground = new SolidColorBrush(Colors.Red);
                ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_ducks = new StackPanel();
                stk_ducks.Height = 50;
                stk_ducks.Children.Add(ducks_content);
                stk_ducks.Children.Add(ducks);




                TextBlock fifties = new TextBlock();
                fifties.Text = batting_odi.ElementAt(0).fiffties;
                fifties.FontSize = 24;
                fifties.HorizontalAlignment = HorizontalAlignment.Right;
                fifties.Foreground = new SolidColorBrush(Colors.Green);
                fifties.Margin = new Thickness(280, -30, 0, 0);
                TextBlock fifties_content = new TextBlock();
                fifties_content.Text = "50'S";
                fifties_content.FontSize = 24;
                fifties_content.Foreground = new SolidColorBrush(Colors.Green);
                fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_fifty = new StackPanel();
                stk_fifty.Height = 50;
                stk_fifty.Children.Add(fifties_content);
                stk_fifty.Children.Add(fifties);


                TextBlock catches = new TextBlock();
                catches.Text = batting_odi.ElementAt(0).catches;
                catches.FontSize = 24;
                catches.Foreground = new SolidColorBrush(Colors.Purple);
                catches.HorizontalAlignment = HorizontalAlignment.Right;
                catches.Margin = new Thickness(280, -30, 0, 0);
                TextBlock catches_content = new TextBlock();
                catches_content.Text = "CATCHES";
                catches_content.FontSize = 24;
                catches_content.Foreground = new SolidColorBrush(Colors.Purple);
                catches_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_catch = new StackPanel();
                stk_catch.Height = 50;
                stk_catch.Children.Add(catches_content);
                stk_catch.Children.Add(catches);



                TextBlock stumings = new TextBlock();
                stumings.Text = batting_odi.ElementAt(0).stumpings;
                stumings.Foreground = new SolidColorBrush(Colors.Red);
                stumings.HorizontalAlignment = HorizontalAlignment.Right;
                stumings.Margin = new Thickness(280, -30, 0, 0);
                stumings.FontSize = 24;
                TextBlock stumings_content = new TextBlock();
                stumings_content.Text = "STUMINGS";
                stumings_content.FontSize = 24;
                stumings_content.Foreground = new SolidColorBrush(Colors.Red);
                stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_stumin = new StackPanel();
                stk_stumin.Height = 50;
                stk_stumin.Children.Add(stumings_content);
                stk_stumin.Children.Add(stumings);

                TextBlock hundreds = new TextBlock();
                hundreds.Text = batting_odi.ElementAt(0).hundreds;
                hundreds.FontSize = 24;
                hundreds.Foreground = new SolidColorBrush(Colors.Blue);
                hundreds.HorizontalAlignment = HorizontalAlignment.Right;
                hundreds.Margin = new Thickness(280, -30, 0, 0);
                TextBlock hundreds_cotent = new TextBlock();
                hundreds_cotent.Text = "100'S";
                hundreds_cotent.FontSize = 24;
                hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
                hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_hundr = new StackPanel();
                stk_hundr.Height = 50;
                stk_hundr.Children.Add(hundreds_cotent);
                stk_hundr.Children.Add(hundreds);



                TextBlock average = new TextBlock();
                average.Text = batting_odi.ElementAt(0).average;
                average.FontSize = 24;
                average.Foreground = new SolidColorBrush(Colors.Brown);
                average.HorizontalAlignment = HorizontalAlignment.Right;
                average.Margin = new Thickness(280, -30, 0, 0);
                TextBlock average_content = new TextBlock();
                average_content.Text = "AVERAGE";
                average_content.FontSize = 24;
                average_content.Foreground = new SolidColorBrush(Colors.Brown);
                average_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_aver = new StackPanel();
                stk_aver.Height = 50;
                stk_aver.Children.Add(average_content);
                stk_aver.Children.Add(average);





                items.HorizontalAlignment = HorizontalAlignment.Center;
                items.Items.Add(stk_matchtype);
                items.Items.Add(stk_match);
                //    items.Items.Add(matches);
                items.Items.Add(stk_inn);
                //  items.Items.Add(matchtype);
                //   items.Items.Add(innings);

                items.Items.Add(stk_not);
                items.Items.Add(stk_runs);
                items.Items.Add(stk_high);
                items.Items.Add(stk_balls);
                items.Items.Add(stk_six);

                //  items.Items.Add(runsscored);
                //  items.Items.Add(ballstaken);
                // items.Items.Add(sixes);
                items.Items.Add(stk_four);
                items.Items.Add(stk_fifty);
                items.Items.Add(stk_ducks);
                items.Items.Add(stk_catch);
                items.Items.Add(stk_stumin);
                items.Items.Add(stk_hundr);
                items.Items.Add(stk_aver);

                // items.Items.Add(fours);
                // items.Items.Add(ducks);
                // items.Items.Add(fifties);
                // items.Items.Add(catches);
                //  items.Items.Add(stumings);
                //  items.Items.Add(hundreds);
                //  items.Items.Add(average);
                stk.Children.Add(items);


                /*
                stk.Children.Add(matches);
                stk.Children.Add(matchtype);
                stk.Children.Add(innings);
                stk.Children.Add(notout);
                stk.Children.Add(runsscored);
                stk.Children.Add(ballstaken);
                stk.Children.Add(sixes);
                stk.Children.Add(fours);
                stk.Children.Add(ducks);
                stk.Children.Add(fifties);
                stk.Children.Add(catches);
                stk.Children.Add(stumings);
                stk.Children.Add(hundreds);
                stk.Children.Add(average); */
                br.Child = stk;
                batting.Child = br;
                batting.IsOpen = true;
            }
            catch (Exception ght)
            {
                MessageBox.Show("please wait it is loading and try again");
            }

        }
        private void btn_test_Click(object sender, RoutedEventArgs e)
        {
            ListBox items = new ListBox();
            // Border br = new Border();
            br.BorderThickness = new Thickness(3.0);
            br.BorderBrush = new SolidColorBrush(Colors.Green);
            br.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_od = new Button();
            btn_od.Content = "ODI";
            btn_od.Name = "btn_odi";
            btn_od.Height = 80;
            btn_od.Width = 100;
            btn_od.BorderThickness = new Thickness(0);
            btn_od.Background = new SolidColorBrush(Colors.Brown);
            btn_od.Margin = new Thickness(0, 0, 0, 0);
            btn_od.Click += new RoutedEventHandler(btn_od_Click);
            btn_od.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_test = new Button();
            btn_test.Content = "TEST";
            btn_test.Name = "btn_test";
            btn_test.Height = 80;
            btn_test.Width = 100;
            btn_test.BorderThickness = new Thickness(0);
            btn_test.Background = new SolidColorBrush(Colors.DarkGray);
            btn_test.HorizontalAlignment = HorizontalAlignment.Center;
            btn_test.Margin = new Thickness(-175, -80, 0, 0);
            btn_test.Click += new RoutedEventHandler(btn_test_Click);
            Button btn_ipl = new Button();
            btn_ipl.Content = "IPL";
            btn_ipl.Name = "btn_ipl";
            btn_ipl.Height = 80;
            btn_ipl.Width = 100;
            btn_ipl.BorderThickness = new Thickness(0);
            btn_ipl.Background = new SolidColorBrush(Colors.Brown);
            btn_ipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ipl.Margin = new Thickness(15, -80, 0, 0);
            btn_ipl.Click += new RoutedEventHandler(btn_ipl_Click);
            Button btn_t20 = new Button();
            btn_t20.Content = "T20";
            btn_t20.Name = "btn_t20";
            btn_t20.Height = 80;
            btn_t20.Width = 100;
            btn_t20.BorderThickness = new Thickness(0);
            btn_t20.Background = new SolidColorBrush(Colors.Brown);
            btn_t20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_t20.Margin = new Thickness(200, -80, 0, 0);
            btn_t20.Click += new RoutedEventHandler(btn_t20_Click);
            Button btn_cl = new Button();
            btn_cl.Content = "CL";
            btn_cl.Name = "btn_cl";
            btn_cl.Height = 80;
            btn_cl.Width = 90;
            btn_cl.BorderThickness = new Thickness(0);
            btn_cl.Background = new SolidColorBrush(Colors.Brown);
            btn_cl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_cl.Margin = new Thickness(10, -80, 0, 0);
            btn_cl.Click += new RoutedEventHandler(btn_cl_Click);
            stk.Children.Add(btn_od);
            stk.Children.Add(btn_test);
            stk.Children.Add(btn_ipl);
            stk.Children.Add(btn_t20);
            stk.Children.Add(btn_cl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = batting_test.ElementAt(0).matches;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "MATCHES";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = batting_test.ElementAt(0).innings;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(280, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "INNINGS";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = batting_test.ElementAt(0).matchtype;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "MATCH TYPE";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = batting_test.ElementAt(0).notouts;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(280, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "NOT OUT";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = batting_test.ElementAt(0).runsscored;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "RUNS SCORED";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = batting_test.ElementAt(0).highestscore;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "HIGHEST SCORE";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);



            TextBlock ballstaken = new TextBlock();
            ballstaken.Text = batting_test.ElementAt(0).ballstaken;
            ballstaken.FontSize = 24;
            ballstaken.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
            ballstaken.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ballstaken_content = new TextBlock();
            ballstaken_content.Text = "BALLS TAKEN";
            ballstaken_content.FontSize = 24;
            ballstaken_content.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_balls = new StackPanel();
            stk_balls.Height = 50;
            stk_balls.Children.Add(ballstaken_content);
            stk_balls.Children.Add(ballstaken);





            TextBlock sixes = new TextBlock();
            sixes.Text = batting_test.ElementAt(0).sixes;
            sixes.FontSize = 24;
            sixes.Foreground = new SolidColorBrush(Colors.Green);
            sixes.HorizontalAlignment = HorizontalAlignment.Right;
            sixes.Margin = new Thickness(280, -30, 0, 0);
            TextBlock sixes_content = new TextBlock();
            sixes_content.Text = "6'S";
            sixes_content.FontSize = 24;
            sixes_content.Foreground = new SolidColorBrush(Colors.Green);
            sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_six = new StackPanel();
            stk_six.Height = 50;
            stk_six.Children.Add(sixes_content);
            stk_six.Children.Add(sixes);


            TextBlock fours = new TextBlock();
            fours.Text = batting_test.ElementAt(0).fours;
            fours.Foreground = new SolidColorBrush(Colors.Brown);
            fours.HorizontalAlignment = HorizontalAlignment.Right;
            fours.FontSize = 24;
            fours.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fours_content = new TextBlock();
            fours_content.Text = "4'S";
            fours_content.FontSize = 24;
            fours_content.Foreground = new SolidColorBrush(Colors.Brown);
            fours_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_four = new StackPanel();
            stk_four.Height = 50;
            stk_four.Children.Add(fours_content);
            stk_four.Children.Add(fours);


            TextBlock ducks = new TextBlock();
            ducks.Text = batting_test.ElementAt(0).ducks;
            ducks.FontSize = 24;
            ducks.Foreground = new SolidColorBrush(Colors.Red);
            ducks.HorizontalAlignment = HorizontalAlignment.Right;
            ducks.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ducks_content = new TextBlock();
            ducks_content.Text = "DUCKS";
            ducks_content.FontSize = 24;
            ducks_content.Foreground = new SolidColorBrush(Colors.Red);
            ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_ducks = new StackPanel();
            stk_ducks.Height = 50;
            stk_ducks.Children.Add(ducks_content);
            stk_ducks.Children.Add(ducks);




            TextBlock fifties = new TextBlock();
            fifties.Text = batting_test.ElementAt(0).fiffties;
            fifties.FontSize = 24;
            fifties.HorizontalAlignment = HorizontalAlignment.Right;
            fifties.Foreground = new SolidColorBrush(Colors.Black);
            fifties.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fifties_content = new TextBlock();
            fifties_content.Text = "50'S";
            fifties_content.FontSize = 24;
            fifties_content.Foreground = new SolidColorBrush(Colors.Black);
            fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_fifty = new StackPanel();
            stk_fifty.Height = 50;
            stk_fifty.Children.Add(fifties_content);
            stk_fifty.Children.Add(fifties);


            TextBlock catches = new TextBlock();
            catches.Text = batting_test.ElementAt(0).catches;
            catches.FontSize = 24;
            catches.Foreground = new SolidColorBrush(Colors.Purple);
            catches.HorizontalAlignment = HorizontalAlignment.Right;
            catches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock catches_content = new TextBlock();
            catches_content.Text = "CATCHES";
            catches_content.FontSize = 24;
            catches_content.Foreground = new SolidColorBrush(Colors.Purple);
            catches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_catch = new StackPanel();
            stk_catch.Height = 50;
            stk_catch.Children.Add(catches_content);
            stk_catch.Children.Add(catches);



            TextBlock stumings = new TextBlock();
            stumings.Text = batting_test.ElementAt(0).stumpings;
            stumings.Foreground = new SolidColorBrush(Colors.Red);
            stumings.HorizontalAlignment = HorizontalAlignment.Right;
            stumings.Margin = new Thickness(280, -30, 0, 0);
            stumings.FontSize = 24;
            TextBlock stumings_content = new TextBlock();
            stumings_content.Text = "STUMINGS";
            stumings_content.FontSize = 24;
            stumings_content.Foreground = new SolidColorBrush(Colors.Red);
            stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_stumin = new StackPanel();
            stk_stumin.Height = 50;
            stk_stumin.Children.Add(stumings_content);
            stk_stumin.Children.Add(stumings);

            TextBlock hundreds = new TextBlock();
            hundreds.Text = batting_test.ElementAt(0).hundreds;
            hundreds.FontSize = 24;
            hundreds.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds.HorizontalAlignment = HorizontalAlignment.Right;
            hundreds.Margin = new Thickness(280, -30, 0, 0);
            TextBlock hundreds_cotent = new TextBlock();
            hundreds_cotent.Text = "100'S";
            hundreds_cotent.FontSize = 24;
            hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_hundr = new StackPanel();
            stk_hundr.Height = 50;
            stk_hundr.Children.Add(hundreds_cotent);
            stk_hundr.Children.Add(hundreds);



            TextBlock average = new TextBlock();
            average.Text = batting_test.ElementAt(0).average;
            average.FontSize = 24;
            average.Foreground = new SolidColorBrush(Colors.Black);
            average.HorizontalAlignment = HorizontalAlignment.Right;
            average.Margin = new Thickness(280, -30, 0, 0);
            TextBlock average_content = new TextBlock();
            average_content.Text = "AVERAGE";
            average_content.FontSize = 24;
            average_content.Foreground = new SolidColorBrush(Colors.Black);
            average_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_aver = new StackPanel();
            stk_aver.Height = 50;
            stk_aver.Children.Add(average_content);
            stk_aver.Children.Add(average);





            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            items.Items.Add(stk_balls);
            items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            items.Items.Add(stk_four);
            items.Items.Add(stk_fifty);
            items.Items.Add(stk_ducks);
            items.Items.Add(stk_catch);
            items.Items.Add(stk_stumin);
            items.Items.Add(stk_hundr);
            items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);


            /*
            stk.Children.Add(matches);
            stk.Children.Add(matchtype);
            stk.Children.Add(innings);
            stk.Children.Add(notout);
            stk.Children.Add(runsscored);
            stk.Children.Add(ballstaken);
            stk.Children.Add(sixes);
            stk.Children.Add(fours);
            stk.Children.Add(ducks);
            stk.Children.Add(fifties);
            stk.Children.Add(catches);
            stk.Children.Add(stumings);
            stk.Children.Add(hundreds);
            stk.Children.Add(average); */
            br.Child = stk;
            batting.Child = br;
            batting.IsOpen = true;
 
        }
        private void btn_ipl_Click(object sender, RoutedEventArgs e)
        {
            ListBox items = new ListBox();
            // Border br = new Border();
            br.BorderThickness = new Thickness(3.0);
            br.BorderBrush = new SolidColorBrush(Colors.Green);
            br.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_od = new Button();
            btn_od.Content = "ODI";
            btn_od.Name = "btn_odi";
            btn_od.Height = 80;
            btn_od.Width = 100;
            btn_od.BorderThickness = new Thickness(0);
            btn_od.Background = new SolidColorBrush(Colors.Brown);
            btn_od.Margin = new Thickness(0, 0, 0, 0);
            btn_od.Click += new RoutedEventHandler(btn_od_Click);
            btn_od.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_test = new Button();
            btn_test.Content = "TEST";
            btn_test.Name = "btn_test";
            btn_test.Height = 80;
            btn_test.Width = 100;
            btn_test.BorderThickness = new Thickness(0);
            btn_test.Background = new SolidColorBrush(Colors.Brown);
            btn_test.HorizontalAlignment = HorizontalAlignment.Center;
            btn_test.Margin = new Thickness(-175, -80, 0, 0);
            btn_test.Click += new RoutedEventHandler(btn_test_Click);
            Button btn_ipl = new Button();
            btn_ipl.Content = "IPL";
            btn_ipl.Name = "btn_ipl";
            btn_ipl.Height = 80;
            btn_ipl.Width = 100;
            btn_ipl.BorderThickness = new Thickness(0);
            btn_ipl.Background = new SolidColorBrush(Colors.DarkGray);
            btn_ipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ipl.Margin = new Thickness(15, -80, 0, 0);
            btn_ipl.Click += new RoutedEventHandler(btn_ipl_Click);
            Button btn_t20 = new Button();
            btn_t20.Content = "T20";
            btn_t20.Name = "btn_t20";
            btn_t20.Height = 80;
            btn_t20.Width = 100;
            btn_t20.BorderThickness = new Thickness(0);
            btn_t20.Background = new SolidColorBrush(Colors.Brown);
            btn_t20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_t20.Margin = new Thickness(200, -80, 0, 0);
            btn_t20.Click += new RoutedEventHandler(btn_t20_Click);
            Button btn_cl = new Button();
            btn_cl.Content = "CL";
            btn_cl.Name = "btn_cl";
            btn_cl.Height = 80;
            btn_cl.Width = 90;
            btn_cl.BorderThickness = new Thickness(0);
            btn_cl.Background = new SolidColorBrush(Colors.Brown);
            btn_cl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_cl.Margin = new Thickness(10, -80, 0, 0);
            btn_cl.Click += new RoutedEventHandler(btn_cl_Click);
            stk.Children.Add(btn_od);
            stk.Children.Add(btn_test);
            stk.Children.Add(btn_ipl);
            stk.Children.Add(btn_t20);
            stk.Children.Add(btn_cl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = batting_ipl.ElementAt(0).matches;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "MATCHES";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = batting_ipl.ElementAt(0).innings;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(280, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "INNINGS";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = batting_ipl.ElementAt(0).matchtype;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "MATCH TYPE";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = batting_ipl.ElementAt(0).notouts;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(280, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "NOT OUT";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = batting_ipl.ElementAt(0).runsscored;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "RUNS SCORED";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = batting_ipl.ElementAt(0).highestscore;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "HIGHEST SCORE";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);



            TextBlock ballstaken = new TextBlock();
            ballstaken.Text = batting_ipl.ElementAt(0).ballstaken;
            ballstaken.FontSize = 24;
            ballstaken.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
            ballstaken.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ballstaken_content = new TextBlock();
            ballstaken_content.Text = "BALLS TAKEN";
            ballstaken_content.FontSize = 24;
            ballstaken_content.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_balls = new StackPanel();
            stk_balls.Height = 50;
            stk_balls.Children.Add(ballstaken_content);
            stk_balls.Children.Add(ballstaken);





            TextBlock sixes = new TextBlock();
            sixes.Text = batting_ipl.ElementAt(0).sixes;
            sixes.FontSize = 24;
            sixes.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes.HorizontalAlignment = HorizontalAlignment.Right;
            sixes.Margin = new Thickness(280, -30, 0, 0);
            TextBlock sixes_content = new TextBlock();
            sixes_content.Text = "6'S";
            sixes_content.FontSize = 24;
            sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_six = new StackPanel();
            stk_six.Height = 50;
            stk_six.Children.Add(sixes_content);
            stk_six.Children.Add(sixes);


            TextBlock fours = new TextBlock();
            fours.Text = batting_ipl.ElementAt(0).fours;
            fours.Foreground = new SolidColorBrush(Colors.Brown);
            fours.HorizontalAlignment = HorizontalAlignment.Right;
            fours.FontSize = 24;
            fours.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fours_content = new TextBlock();
            fours_content.Text = "4'S";
            fours_content.FontSize = 24;
            fours_content.Foreground = new SolidColorBrush(Colors.Brown);
            fours_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_four = new StackPanel();
            stk_four.Height = 50;
            stk_four.Children.Add(fours_content);
            stk_four.Children.Add(fours);


            TextBlock ducks = new TextBlock();
            ducks.Text = batting_ipl.ElementAt(0).ducks;
            ducks.FontSize = 24;
            ducks.Foreground = new SolidColorBrush(Colors.Black);
            ducks.HorizontalAlignment = HorizontalAlignment.Right;
            ducks.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ducks_content = new TextBlock();
            ducks_content.Text = "DUCKS";
            ducks_content.FontSize = 24;
            ducks_content.Foreground = new SolidColorBrush(Colors.Black);
            ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_ducks = new StackPanel();
            stk_ducks.Height = 50;
            stk_ducks.Children.Add(ducks_content);
            stk_ducks.Children.Add(ducks);




            TextBlock fifties = new TextBlock();
            fifties.Text = batting_ipl.ElementAt(0).fiffties;
            fifties.FontSize = 24;
            fifties.HorizontalAlignment = HorizontalAlignment.Right;
            fifties.Foreground = new SolidColorBrush(Colors.Green);
            fifties.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fifties_content = new TextBlock();
            fifties_content.Text = "50'S";
            fifties_content.FontSize = 24;
            fifties_content.Foreground = new SolidColorBrush(Colors.Green);
            fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_fifty = new StackPanel();
            stk_fifty.Height = 50;
            stk_fifty.Children.Add(fifties_content);
            stk_fifty.Children.Add(fifties);


            TextBlock catches = new TextBlock();
            catches.Text = batting_ipl.ElementAt(0).catches;
            catches.FontSize = 24;
            catches.Foreground = new SolidColorBrush(Colors.Purple);
            catches.HorizontalAlignment = HorizontalAlignment.Right;
            catches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock catches_content = new TextBlock();
            catches_content.Text = "CATCHES";
            catches_content.FontSize = 24;
            catches_content.Foreground = new SolidColorBrush(Colors.Purple);
            catches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_catch = new StackPanel();
            stk_catch.Height = 50;
            stk_catch.Children.Add(catches_content);
            stk_catch.Children.Add(catches);



            TextBlock stumings = new TextBlock();
            stumings.Text = batting_ipl.ElementAt(0).stumpings;
            stumings.Foreground = new SolidColorBrush(Colors.Red);
            stumings.HorizontalAlignment = HorizontalAlignment.Right;
            stumings.Margin = new Thickness(280, -30, 0, 0);
            stumings.FontSize = 24;
            TextBlock stumings_content = new TextBlock();
            stumings_content.Text = "STUMINGS";
            stumings_content.FontSize = 24;
            stumings_content.Foreground = new SolidColorBrush(Colors.Red);
            stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_stumin = new StackPanel();
            stk_stumin.Height = 50;
            stk_stumin.Children.Add(stumings_content);
            stk_stumin.Children.Add(stumings);

            TextBlock hundreds = new TextBlock();
            hundreds.Text = batting_ipl.ElementAt(0).hundreds;
            hundreds.FontSize = 24;
            hundreds.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds.HorizontalAlignment = HorizontalAlignment.Right;
            hundreds.Margin = new Thickness(280, -30, 0, 0);
            TextBlock hundreds_cotent = new TextBlock();
            hundreds_cotent.Text = "100'S";
            hundreds_cotent.FontSize = 24;
            hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_hundr = new StackPanel();
            stk_hundr.Height = 50;
            stk_hundr.Children.Add(hundreds_cotent);
            stk_hundr.Children.Add(hundreds);



            TextBlock average = new TextBlock();
            average.Text = batting_ipl.ElementAt(0).average;
            average.FontSize = 24;
            average.Foreground = new SolidColorBrush(Colors.Black);
            average.HorizontalAlignment = HorizontalAlignment.Right;
            average.Margin = new Thickness(280, -30, 0, 0);
            TextBlock average_content = new TextBlock();
            average_content.Text = "AVERAGE";
            average_content.FontSize = 24;
            average_content.Foreground = new SolidColorBrush(Colors.Black);
            average_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_aver = new StackPanel();
            stk_aver.Height = 50;
            stk_aver.Children.Add(average_content);
            stk_aver.Children.Add(average);





            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            items.Items.Add(stk_balls);
            items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            items.Items.Add(stk_four);
            items.Items.Add(stk_fifty);
            items.Items.Add(stk_ducks);
            items.Items.Add(stk_catch);
            items.Items.Add(stk_stumin);
            items.Items.Add(stk_hundr);
            items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);


            /*
            stk.Children.Add(matches);
            stk.Children.Add(matchtype);
            stk.Children.Add(innings);
            stk.Children.Add(notout);
            stk.Children.Add(runsscored);
            stk.Children.Add(ballstaken);
            stk.Children.Add(sixes);
            stk.Children.Add(fours);
            stk.Children.Add(ducks);
            stk.Children.Add(fifties);
            stk.Children.Add(catches);
            stk.Children.Add(stumings);
            stk.Children.Add(hundreds);
            stk.Children.Add(average); */
            br.Child = stk;
            batting.Child = br;
            batting.IsOpen = true;
 
        }
        private void btn_od_Click(object sender, RoutedEventArgs e)
        {
            ListBox items = new ListBox();
            // Border br = new Border();
            br.BorderThickness = new Thickness(3.0);
            br.BorderBrush = new SolidColorBrush(Colors.Green);
            br.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_od = new Button();
            btn_od.Content = "ODI";
            btn_od.Name = "btn_odi";
            btn_od.Height = 80;
            btn_od.Width = 100;
            btn_od.BorderThickness = new Thickness(0);
            btn_od.Background = new SolidColorBrush(Colors.DarkGray);
            btn_od.Margin = new Thickness(0, 0, 0, 0);
            btn_od.Click += new RoutedEventHandler(btn_od_Click);
            btn_od.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_test = new Button();
            btn_test.Content = "TEST";
            btn_test.Name = "btn_test";
            btn_test.Height = 80;
            btn_test.Width = 100;
            btn_test.BorderThickness = new Thickness(0);
            btn_test.Background = new SolidColorBrush(Colors.Brown);
            btn_test.HorizontalAlignment = HorizontalAlignment.Center;
            btn_test.Margin = new Thickness(-175, -80, 0, 0);
            btn_test.Click += new RoutedEventHandler(btn_test_Click);
            Button btn_ipl = new Button();
            btn_ipl.Content = "IPL";
            btn_ipl.Name = "btn_ipl";
            btn_ipl.Height = 80;
            btn_ipl.Width = 100;
            btn_ipl.BorderThickness = new Thickness(0);
            btn_ipl.Background = new SolidColorBrush(Colors.Brown);
            btn_ipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ipl.Margin = new Thickness(15, -80, 0, 0);
            btn_ipl.Click += new RoutedEventHandler(btn_ipl_Click);
            Button btn_t20 = new Button();
            btn_t20.Content = "T20";
            btn_t20.Name = "btn_t20";
            btn_t20.Height = 80;
            btn_t20.Width = 100;
            btn_t20.BorderThickness = new Thickness(0);
            btn_t20.Background = new SolidColorBrush(Colors.Brown);
            btn_t20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_t20.Margin = new Thickness(200, -80, 0, 0);
            btn_t20.Click += new RoutedEventHandler(btn_t20_Click);
            Button btn_cl = new Button();
            btn_cl.Content = "CL";
            btn_cl.Name = "btn_cl";
            btn_cl.Height = 80;
            btn_cl.Width = 90;
            btn_cl.BorderThickness = new Thickness(0);
            btn_cl.Background = new SolidColorBrush(Colors.Brown);
            btn_cl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_cl.Margin = new Thickness(10, -80, 0, 0);
            btn_cl.Click += new RoutedEventHandler(btn_cl_Click);
            stk.Children.Add(btn_od);
            stk.Children.Add(btn_test);
            stk.Children.Add(btn_ipl);
            stk.Children.Add(btn_t20);
            stk.Children.Add(btn_cl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = batting_odi.ElementAt(0).matches;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "MATCHES";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = batting_odi.ElementAt(0).innings;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(280, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "INNINGS";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = batting_odi.ElementAt(0).matchtype;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "MATCH TYPE";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = batting_odi.ElementAt(0).notouts;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(280, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "NOT OUT";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = batting_odi.ElementAt(0).runsscored;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "RUNS SCORED";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = batting_odi.ElementAt(0).highestscore;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "HIGHEST SCORE";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);



            TextBlock ballstaken = new TextBlock();
            ballstaken.Text = batting_odi.ElementAt(0).ballstaken;
            ballstaken.FontSize = 24;
            ballstaken.Foreground = new SolidColorBrush(Colors.Brown);
            ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
            ballstaken.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ballstaken_content = new TextBlock();
            ballstaken_content.Text = "BALLS TAKEN";
            ballstaken_content.FontSize = 24;
            ballstaken_content.Foreground = new SolidColorBrush(Colors.Brown);
            ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_balls = new StackPanel();
            stk_balls.Height = 50;
            stk_balls.Children.Add(ballstaken_content);
            stk_balls.Children.Add(ballstaken);





            TextBlock sixes = new TextBlock();
            sixes.Text = batting_odi.ElementAt(0).sixes;
            sixes.FontSize = 24;
            sixes.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes.HorizontalAlignment = HorizontalAlignment.Right;
            sixes.Margin = new Thickness(280, -30, 0, 0);
            TextBlock sixes_content = new TextBlock();
            sixes_content.Text = "6'S";
            sixes_content.FontSize = 24;
            sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_six = new StackPanel();
            stk_six.Height = 50;
            stk_six.Children.Add(sixes_content);
            stk_six.Children.Add(sixes);


            TextBlock fours = new TextBlock();
            fours.Text = batting_odi.ElementAt(0).fours;
            fours.Foreground = new SolidColorBrush(Colors.Brown);
            fours.HorizontalAlignment = HorizontalAlignment.Right;
            fours.FontSize = 24;
            fours.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fours_content = new TextBlock();
            fours_content.Text = "4'S";
            fours_content.FontSize = 24;
            fours_content.Foreground = new SolidColorBrush(Colors.Brown);
            fours_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_four = new StackPanel();
            stk_four.Height = 50;
            stk_four.Children.Add(fours_content);
            stk_four.Children.Add(fours);


            TextBlock ducks = new TextBlock();
            ducks.Text = batting_odi.ElementAt(0).ducks;
            ducks.FontSize = 24;
            ducks.Foreground = new SolidColorBrush(Colors.Blue);
            ducks.HorizontalAlignment = HorizontalAlignment.Right;
            ducks.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ducks_content = new TextBlock();
            ducks_content.Text = "DUCKS";
            ducks_content.FontSize = 24;
            ducks_content.Foreground = new SolidColorBrush(Colors.Blue);
            ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_ducks = new StackPanel();
            stk_ducks.Height = 50;
            stk_ducks.Children.Add(ducks_content);
            stk_ducks.Children.Add(ducks);




            TextBlock fifties = new TextBlock();
            fifties.Text = batting_odi.ElementAt(0).fiffties;
            fifties.FontSize = 24;
            fifties.HorizontalAlignment = HorizontalAlignment.Right;
            fifties.Foreground = new SolidColorBrush(Colors.Green);
            fifties.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fifties_content = new TextBlock();
            fifties_content.Text = "50'S";
            fifties_content.FontSize = 24;
            fifties_content.Foreground = new SolidColorBrush(Colors.Green);
            fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_fifty = new StackPanel();
            stk_fifty.Height = 50;
            stk_fifty.Children.Add(fifties_content);
            stk_fifty.Children.Add(fifties);


            TextBlock catches = new TextBlock();
            catches.Text = batting_odi.ElementAt(0).catches;
            catches.FontSize = 24;
            catches.Foreground = new SolidColorBrush(Colors.Purple);
            catches.HorizontalAlignment = HorizontalAlignment.Right;
            catches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock catches_content = new TextBlock();
            catches_content.Text = "CATCHES";
            catches_content.FontSize = 24;
            catches_content.Foreground = new SolidColorBrush(Colors.Purple);
            catches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_catch = new StackPanel();
            stk_catch.Height = 50;
            stk_catch.Children.Add(catches_content);
            stk_catch.Children.Add(catches);



            TextBlock stumings = new TextBlock();
            stumings.Text = batting_odi.ElementAt(0).stumpings;
            stumings.Foreground = new SolidColorBrush(Colors.Red);
            stumings.HorizontalAlignment = HorizontalAlignment.Right;
            stumings.Margin = new Thickness(280, -30, 0, 0);
            stumings.FontSize = 24;
            TextBlock stumings_content = new TextBlock();
            stumings_content.Text = "STUMINGS";
            stumings_content.FontSize = 24;
            stumings_content.Foreground = new SolidColorBrush(Colors.Red);
            stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_stumin = new StackPanel();
            stk_stumin.Height = 50;
            stk_stumin.Children.Add(stumings_content);
            stk_stumin.Children.Add(stumings);

            TextBlock hundreds = new TextBlock();
            hundreds.Text = batting_odi.ElementAt(0).hundreds;
            hundreds.FontSize = 24;
            hundreds.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds.HorizontalAlignment = HorizontalAlignment.Right;
            hundreds.Margin = new Thickness(280, -30, 0, 0);
            TextBlock hundreds_cotent = new TextBlock();
            hundreds_cotent.Text = "100'S";
            hundreds_cotent.FontSize = 24;
            hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_hundr = new StackPanel();
            stk_hundr.Height = 50;
            stk_hundr.Children.Add(hundreds_cotent);
            stk_hundr.Children.Add(hundreds);



            TextBlock average = new TextBlock();
            average.Text = batting_odi.ElementAt(0).average;
            average.FontSize = 24;
            average.Foreground = new SolidColorBrush(Colors.Black);
            average.HorizontalAlignment = HorizontalAlignment.Right;
            average.Margin = new Thickness(280, -30, 0, 0);
            TextBlock average_content = new TextBlock();
            average_content.Text = "AVERAGE";
            average_content.FontSize = 24;
            average_content.Foreground = new SolidColorBrush(Colors.Black);
            average_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_aver = new StackPanel();
            stk_aver.Height = 50;
            stk_aver.Children.Add(average_content);
            stk_aver.Children.Add(average);





            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            items.Items.Add(stk_balls);
            items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            items.Items.Add(stk_four);
            items.Items.Add(stk_fifty);
            items.Items.Add(stk_ducks);
            items.Items.Add(stk_catch);
            items.Items.Add(stk_stumin);
            items.Items.Add(stk_hundr);
            items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);


            /*
            stk.Children.Add(matches);
            stk.Children.Add(matchtype);
            stk.Children.Add(innings);
            stk.Children.Add(notout);
            stk.Children.Add(runsscored);
            stk.Children.Add(ballstaken);
            stk.Children.Add(sixes);
            stk.Children.Add(fours);
            stk.Children.Add(ducks);
            stk.Children.Add(fifties);
            stk.Children.Add(catches);
            stk.Children.Add(stumings);
            stk.Children.Add(hundreds);
            stk.Children.Add(average); */
            br.Child = stk;
            batting.Child = br;
            batting.IsOpen = true;
 
        }
        private void btn_t20_Click(object sender, RoutedEventArgs e)
        {
            ListBox items = new ListBox();
            // Border br = new Border();
            br.BorderThickness = new Thickness(3.0);
            br.BorderBrush = new SolidColorBrush(Colors.Green);
            br.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_od = new Button();
            btn_od.Content = "ODI";
            btn_od.Name = "btn_odi";
            btn_od.Height = 80;
            btn_od.Width = 100;
            btn_od.BorderThickness = new Thickness(0);
            btn_od.Background = new SolidColorBrush(Colors.Brown);
            btn_od.Margin = new Thickness(0, 0, 0, 0);
            btn_od.Click += new RoutedEventHandler(btn_od_Click);
            btn_od.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_test = new Button();
            btn_test.Content = "TEST";
            btn_test.Name = "btn_test";
            btn_test.Height = 80;
            btn_test.Width = 100;
            btn_test.BorderThickness = new Thickness(0);
            btn_test.Background = new SolidColorBrush(Colors.Brown);
            btn_test.HorizontalAlignment = HorizontalAlignment.Center;
            btn_test.Margin = new Thickness(-175, -80, 0, 0);
            btn_test.Click += new RoutedEventHandler(btn_test_Click);
            Button btn_ipl = new Button();
            btn_ipl.Content = "IPL";
            btn_ipl.Name = "btn_ipl";
            btn_ipl.Height = 80;
            btn_ipl.Width = 100;
            btn_ipl.BorderThickness = new Thickness(0);
            btn_ipl.Background = new SolidColorBrush(Colors.Brown);
            btn_ipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ipl.Margin = new Thickness(15, -80, 0, 0);
            btn_ipl.Click += new RoutedEventHandler(btn_ipl_Click);
            Button btn_t20 = new Button();
            btn_t20.Content = "T20";
            btn_t20.Name = "btn_t20";
            btn_t20.Height = 80;
            btn_t20.Width = 100;
            btn_t20.BorderThickness = new Thickness(0);
            btn_t20.Background = new SolidColorBrush(Colors.DarkGray);
            btn_t20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_t20.Margin = new Thickness(200, -80, 0, 0);
            btn_t20.Click += new RoutedEventHandler(btn_t20_Click);
            Button btn_cl = new Button();
            btn_cl.Content = "CL";
            btn_cl.Name = "btn_cl";
            btn_cl.Height = 80;
            btn_cl.Width = 90;
            btn_cl.BorderThickness = new Thickness(0);
            btn_cl.Background = new SolidColorBrush(Colors.Brown);
            btn_cl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_cl.Margin = new Thickness(10, -80, 0, 0);
            btn_cl.Click += new RoutedEventHandler(btn_cl_Click);
            stk.Children.Add(btn_od);
            stk.Children.Add(btn_test);
            stk.Children.Add(btn_ipl);
            stk.Children.Add(btn_t20);
            stk.Children.Add(btn_cl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = batting_t20.ElementAt(0).matches;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "MATCHES";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = batting_t20.ElementAt(0).innings;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(280, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "INNINGS";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = batting_t20.ElementAt(0).matchtype;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "MATCH TYPE";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = batting_t20.ElementAt(0).notouts;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(280, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "NOT OUT";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = batting_t20.ElementAt(0).runsscored;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "RUNS SCORED";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = batting_t20.ElementAt(0).highestscore;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "HIGHEST SCORE";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);



            TextBlock ballstaken = new TextBlock();
            ballstaken.Text = batting_t20.ElementAt(0).ballstaken;
            ballstaken.FontSize = 24;
            ballstaken.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
            ballstaken.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ballstaken_content = new TextBlock();
            ballstaken_content.Text = "BALLS TAKEN";
            ballstaken_content.FontSize = 24;
            ballstaken_content.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_balls = new StackPanel();
            stk_balls.Height = 50;
            stk_balls.Children.Add(ballstaken_content);
            stk_balls.Children.Add(ballstaken);





            TextBlock sixes = new TextBlock();
            sixes.Text = batting_t20.ElementAt(0).sixes;
            sixes.FontSize = 24;
            sixes.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes.HorizontalAlignment = HorizontalAlignment.Right;
            sixes.Margin = new Thickness(280, -30, 0, 0);
            TextBlock sixes_content = new TextBlock();
            sixes_content.Text = "6'S";
            sixes_content.FontSize = 24;
            sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_six = new StackPanel();
            stk_six.Height = 50;
            stk_six.Children.Add(sixes_content);
            stk_six.Children.Add(sixes);


            TextBlock fours = new TextBlock();
            fours.Text = batting_t20.ElementAt(0).fours;
            fours.Foreground = new SolidColorBrush(Colors.Brown);
            fours.HorizontalAlignment = HorizontalAlignment.Right;
            fours.FontSize = 24;
            fours.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fours_content = new TextBlock();
            fours_content.Text = "4'S";
            fours_content.FontSize = 24;
            fours_content.Foreground = new SolidColorBrush(Colors.Brown);
            fours_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_four = new StackPanel();
            stk_four.Height = 50;
            stk_four.Children.Add(fours_content);
            stk_four.Children.Add(fours);


            TextBlock ducks = new TextBlock();
            ducks.Text = batting_t20.ElementAt(0).ducks;
            ducks.FontSize = 24;
            ducks.Foreground = new SolidColorBrush(Colors.Black);
            ducks.HorizontalAlignment = HorizontalAlignment.Right;
            ducks.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ducks_content = new TextBlock();
            ducks_content.Text = "DUCKS";
            ducks_content.FontSize = 24;
            ducks_content.Foreground = new SolidColorBrush(Colors.Black);
            ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_ducks = new StackPanel();
            stk_ducks.Height = 50;
            stk_ducks.Children.Add(ducks_content);
            stk_ducks.Children.Add(ducks);




            TextBlock fifties = new TextBlock();
            fifties.Text = batting_t20.ElementAt(0).fiffties;
            fifties.FontSize = 24;
            fifties.HorizontalAlignment = HorizontalAlignment.Right;
            fifties.Foreground = new SolidColorBrush(Colors.Green);
            fifties.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fifties_content = new TextBlock();
            fifties_content.Text = "50'S";
            fifties_content.FontSize = 24;
            fifties_content.Foreground = new SolidColorBrush(Colors.Green);
            fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_fifty = new StackPanel();
            stk_fifty.Height = 50;
            stk_fifty.Children.Add(fifties_content);
            stk_fifty.Children.Add(fifties);


            TextBlock catches = new TextBlock();
            catches.Text = batting_t20.ElementAt(0).catches;
            catches.FontSize = 24;
            catches.Foreground = new SolidColorBrush(Colors.Purple);
            catches.HorizontalAlignment = HorizontalAlignment.Right;
            catches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock catches_content = new TextBlock();
            catches_content.Text = "CATCHES";
            catches_content.FontSize = 24;
            catches_content.Foreground = new SolidColorBrush(Colors.Purple);
            catches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_catch = new StackPanel();
            stk_catch.Height = 50;
            stk_catch.Children.Add(catches_content);
            stk_catch.Children.Add(catches);



            TextBlock stumings = new TextBlock();
            stumings.Text = batting_t20.ElementAt(0).stumpings;
            stumings.Foreground = new SolidColorBrush(Colors.Red);
            stumings.HorizontalAlignment = HorizontalAlignment.Right;
            stumings.Margin = new Thickness(280, -30, 0, 0);
            stumings.FontSize = 24;
            TextBlock stumings_content = new TextBlock();
            stumings_content.Text = "STUMINGS";
            stumings_content.FontSize = 24;
            stumings_content.Foreground = new SolidColorBrush(Colors.Red);
            stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_stumin = new StackPanel();
            stk_stumin.Height = 50;
            stk_stumin.Children.Add(stumings_content);
            stk_stumin.Children.Add(stumings);

            TextBlock hundreds = new TextBlock();
            hundreds.Text = batting_t20.ElementAt(0).hundreds;
            hundreds.FontSize = 24;
            hundreds.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds.HorizontalAlignment = HorizontalAlignment.Right;
            hundreds.Margin = new Thickness(280, -30, 0, 0);
            TextBlock hundreds_cotent = new TextBlock();
            hundreds_cotent.Text = "100'S";
            hundreds_cotent.FontSize = 24;
            hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_hundr = new StackPanel();
            stk_hundr.Height = 50;
            stk_hundr.Children.Add(hundreds_cotent);
            stk_hundr.Children.Add(hundreds);



            TextBlock average = new TextBlock();
            average.Text = batting_t20.ElementAt(0).average;
            average.FontSize = 24;
            average.Foreground = new SolidColorBrush(Colors.Black);
            average.HorizontalAlignment = HorizontalAlignment.Right;
            average.Margin = new Thickness(280, -30, 0, 0);
            TextBlock average_content = new TextBlock();
            average_content.Text = "AVERAGE";
            average_content.FontSize = 24;
            average_content.Foreground = new SolidColorBrush(Colors.Black);
            average_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_aver = new StackPanel();
            stk_aver.Height = 50;
            stk_aver.Children.Add(average_content);
            stk_aver.Children.Add(average);





            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            items.Items.Add(stk_balls);
            items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            items.Items.Add(stk_four);
            items.Items.Add(stk_fifty);
            items.Items.Add(stk_ducks);
            items.Items.Add(stk_catch);
            items.Items.Add(stk_stumin);
            items.Items.Add(stk_hundr);
            items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);


            /*
            stk.Children.Add(matches);
            stk.Children.Add(matchtype);
            stk.Children.Add(innings);
            stk.Children.Add(notout);
            stk.Children.Add(runsscored);
            stk.Children.Add(ballstaken);
            stk.Children.Add(sixes);
            stk.Children.Add(fours);
            stk.Children.Add(ducks);
            stk.Children.Add(fifties);
            stk.Children.Add(catches);
            stk.Children.Add(stumings);
            stk.Children.Add(hundreds);
            stk.Children.Add(average); */
            br.Child = stk;
            batting.Child = br;
            batting.IsOpen = true;
 
        }
        private void btn_cl_Click(object sender, RoutedEventArgs e)
        {
            ListBox items = new ListBox();
            // Border br = new Border();
            br.BorderThickness = new Thickness(3.0);
            br.BorderBrush = new SolidColorBrush(Colors.Green);
            br.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_od = new Button();
            btn_od.Content = "ODI";
            btn_od.Name = "btn_odi";
            btn_od.Height = 80;
            btn_od.Width = 100;
            btn_od.BorderThickness = new Thickness(0);
            btn_od.Background = new SolidColorBrush(Colors.Brown);
            btn_od.Margin = new Thickness(0, 0, 0, 0);
            btn_od.Click += new RoutedEventHandler(btn_od_Click);
            btn_od.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_test = new Button();
            btn_test.Content = "TEST";
            btn_test.Name = "btn_test";
            btn_test.Height = 80;
            btn_test.Width = 100;
            btn_test.BorderThickness = new Thickness(0);
            btn_test.Background = new SolidColorBrush(Colors.Brown);
            btn_test.HorizontalAlignment = HorizontalAlignment.Center;
            btn_test.Margin = new Thickness(-175, -80, 0, 0);
            btn_test.Click += new RoutedEventHandler(btn_test_Click);
            Button btn_ipl = new Button();
            btn_ipl.Content = "IPL";
            btn_ipl.Name = "btn_ipl";
            btn_ipl.Height = 80;
            btn_ipl.Width = 100;
            btn_ipl.BorderThickness = new Thickness(0);
            btn_ipl.Background = new SolidColorBrush(Colors.Brown);
            btn_ipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ipl.Margin = new Thickness(15, -80, 0, 0);
            btn_ipl.Click += new RoutedEventHandler(btn_ipl_Click);
            Button btn_t20 = new Button();
            btn_t20.Content = "T20";
            btn_t20.Name = "btn_t20";
            btn_t20.Height = 80;
            btn_t20.Width = 100;
            btn_t20.BorderThickness = new Thickness(0);
            btn_t20.Background = new SolidColorBrush(Colors.Brown);
            btn_t20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_t20.Margin = new Thickness(200, -80, 0, 0);
            btn_t20.Click += new RoutedEventHandler(btn_t20_Click);
            Button btn_cl = new Button();
            btn_cl.Content = "CL";
            btn_cl.Name = "btn_cl";
            btn_cl.Height = 80;
            btn_cl.Width = 90;
            btn_cl.BorderThickness = new Thickness(0);
            btn_cl.Background = new SolidColorBrush(Colors.DarkGray);
            btn_cl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_cl.Margin = new Thickness(10, -80, 0, 0);
            btn_cl.Click += new RoutedEventHandler(btn_cl_Click);
            stk.Children.Add(btn_od);
            stk.Children.Add(btn_test);
            stk.Children.Add(btn_ipl);
            stk.Children.Add(btn_t20);
            stk.Children.Add(btn_cl);
            items.Height = 480;
            items.Width = 400;

            try
            {
                TextBlock matches = new TextBlock();
                matches.Text = batting_cl.ElementAt(0).matches;
                matches.FontSize = 24;
                matches.HorizontalAlignment = HorizontalAlignment.Right;
                matches.Foreground = new SolidColorBrush(Colors.Red);
                matches.Margin = new Thickness(280, -30, 0, 0);
                TextBlock matches_content = new TextBlock();
                matches_content.Text = "MATCHES";
                matches_content.FontSize = 24;
                matches_content.Foreground = new SolidColorBrush(Colors.Red);
                matches_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_match = new StackPanel();
                stk_match.Height = 50;
                stk_match.Children.Add(matches_content);
                stk_match.Children.Add(matches);


                TextBlock innings = new TextBlock();
                innings.Text = batting_cl.ElementAt(0).innings;
                innings.FontSize = 24;
                innings.HorizontalAlignment = HorizontalAlignment.Right;
                innings.Foreground = new SolidColorBrush(Colors.Blue);
                innings.Margin = new Thickness(280, -30, 0, 0);
                TextBlock innings_content = new TextBlock();
                innings_content.Text = "INNINGS";
                innings_content.FontSize = 24;
                innings_content.Foreground = new SolidColorBrush(Colors.Blue);
                innings_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_inn = new StackPanel();
                stk_inn.Height = 50;
                stk_inn.Children.Add(innings_content);
                stk_inn.Children.Add(innings);

                TextBlock matchtype = new TextBlock();
                matchtype.Text = batting_cl.ElementAt(0).matchtype;
                matchtype.FontSize = 24;
                matchtype.HorizontalAlignment = HorizontalAlignment.Right;
                matchtype.Foreground = new SolidColorBrush(Colors.Blue);
                matchtype.Margin = new Thickness(250, -30, 0, 0);
                TextBlock matchtype_content = new TextBlock();
                matchtype_content.Text = "MATCH TYPE";
                matchtype_content.FontSize = 24;
                matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
                matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
                StackPanel stk_matchtype = new StackPanel();
                stk_matchtype.Height = 50;
                stk_matchtype.Children.Add(matchtype_content);
                stk_matchtype.Children.Add(matchtype);

                TextBlock notout = new TextBlock();
                notout.Text = batting_cl.ElementAt(0).notouts;
                notout.FontSize = 24;
                notout.HorizontalAlignment = HorizontalAlignment.Right;
                notout.Foreground = new SolidColorBrush(Colors.Magenta);

                notout.Margin = new Thickness(280, -30, 0, 0);
                TextBlock notout_content = new TextBlock();
                notout_content.Text = "NOT OUT";
                notout_content.FontSize = 24;
                notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
                notout_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_not = new StackPanel();
                stk_not.Height = 50;
                stk_not.Children.Add(notout_content);
                stk_not.Children.Add(notout);



                TextBlock runsscored = new TextBlock();
                runsscored.Text = batting_cl.ElementAt(0).runsscored;
                runsscored.FontSize = 24;
                runsscored.HorizontalAlignment = HorizontalAlignment.Right;
                runsscored.Foreground = new SolidColorBrush(Colors.Black);
                runsscored.Margin = new Thickness(280, -30, 0, 0);

                TextBlock runsscored_content = new TextBlock();
                runsscored_content.Text = "RUNS SCORED";
                runsscored_content.FontSize = 24;
                runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
                runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
                StackPanel stk_runs = new StackPanel();
                stk_runs.Height = 50;

                stk_runs.Children.Add(runsscored_content);
                stk_runs.Children.Add(runsscored);


                TextBlock highestscore = new TextBlock();
                highestscore.Text = batting_cl.ElementAt(0).highestscore;
                highestscore.FontSize = 24;
                highestscore.Margin = new Thickness(280, -30, 0, 0);
                highestscore.HorizontalAlignment = HorizontalAlignment.Right;
                highestscore.Foreground = new SolidColorBrush(Colors.Purple);

                TextBlock highestscore_content = new TextBlock();
                highestscore_content.Text = "HIGHEST SCORE";
                highestscore_content.FontSize = 24;
                highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
                highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
                StackPanel stk_high = new StackPanel();
                stk_high.Height = 50;

                stk_high.Children.Add(highestscore_content);
                stk_high.Children.Add(highestscore);



                TextBlock ballstaken = new TextBlock();
                ballstaken.Text = batting_cl.ElementAt(0).ballstaken;
                ballstaken.FontSize = 24;
                ballstaken.Foreground = new SolidColorBrush(Colors.Blue);
                ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
                ballstaken.Margin = new Thickness(280, -30, 0, 0);
                TextBlock ballstaken_content = new TextBlock();
                ballstaken_content.Text = "BALLS TAKEN";
                ballstaken_content.FontSize = 24;
                ballstaken_content.Foreground = new SolidColorBrush(Colors.Blue);
                ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_balls = new StackPanel();
                stk_balls.Height = 50;
                stk_balls.Children.Add(ballstaken_content);
                stk_balls.Children.Add(ballstaken);





                TextBlock sixes = new TextBlock();
                sixes.Text = batting_cl.ElementAt(0).sixes;
                sixes.FontSize = 24;
                sixes.Foreground = new SolidColorBrush(Colors.Cyan);
                sixes.HorizontalAlignment = HorizontalAlignment.Right;
                sixes.Margin = new Thickness(280, -30, 0, 0);
                TextBlock sixes_content = new TextBlock();
                sixes_content.Text = "6'S";
                sixes_content.FontSize = 24;
                sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
                sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_six = new StackPanel();
                stk_six.Height = 50;
                stk_six.Children.Add(sixes_content);
                stk_six.Children.Add(sixes);


                TextBlock fours = new TextBlock();
                fours.Text = batting_cl.ElementAt(0).fours;
                fours.Foreground = new SolidColorBrush(Colors.Brown);
                fours.HorizontalAlignment = HorizontalAlignment.Right;
                fours.FontSize = 24;
                fours.Margin = new Thickness(280, -30, 0, 0);
                TextBlock fours_content = new TextBlock();
                fours_content.Text = "4'S";
                fours_content.FontSize = 24;
                fours_content.Foreground = new SolidColorBrush(Colors.Brown);
                fours_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_four = new StackPanel();
                stk_four.Height = 50;
                stk_four.Children.Add(fours_content);
                stk_four.Children.Add(fours);


                TextBlock ducks = new TextBlock();
                ducks.Text = batting_cl.ElementAt(0).ducks;
                ducks.FontSize = 24;
                ducks.Foreground = new SolidColorBrush(Colors.Black);
                ducks.HorizontalAlignment = HorizontalAlignment.Right;
                ducks.Margin = new Thickness(280, -30, 0, 0);
                TextBlock ducks_content = new TextBlock();
                ducks_content.Text = "DUCKS";
                ducks_content.FontSize = 24;
                ducks_content.Foreground = new SolidColorBrush(Colors.Black);
                ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_ducks = new StackPanel();
                stk_ducks.Height = 50;
                stk_ducks.Children.Add(ducks_content);
                stk_ducks.Children.Add(ducks);




                TextBlock fifties = new TextBlock();
                fifties.Text = batting_cl.ElementAt(0).fiffties;
                fifties.FontSize = 24;
                fifties.HorizontalAlignment = HorizontalAlignment.Right;
                fifties.Foreground = new SolidColorBrush(Colors.Green);
                fifties.Margin = new Thickness(280, -30, 0, 0);
                TextBlock fifties_content = new TextBlock();
                fifties_content.Text = "50'S";
                fifties_content.FontSize = 24;
                fifties_content.Foreground = new SolidColorBrush(Colors.Green);
                fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_fifty = new StackPanel();
                stk_fifty.Height = 50;
                stk_fifty.Children.Add(fifties_content);
                stk_fifty.Children.Add(fifties);


                TextBlock catches = new TextBlock();
                catches.Text = batting_cl.ElementAt(0).catches;
                catches.FontSize = 24;
                catches.Foreground = new SolidColorBrush(Colors.Purple);
                catches.HorizontalAlignment = HorizontalAlignment.Right;
                catches.Margin = new Thickness(280, -30, 0, 0);
                TextBlock catches_content = new TextBlock();
                catches_content.Text = "CATCHES";
                catches_content.FontSize = 24;
                catches_content.Foreground = new SolidColorBrush(Colors.Purple);
                catches_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_catch = new StackPanel();
                stk_catch.Height = 50;
                stk_catch.Children.Add(catches_content);
                stk_catch.Children.Add(catches);



                TextBlock stumings = new TextBlock();
                stumings.Text = batting_cl.ElementAt(0).stumpings;
                stumings.Foreground = new SolidColorBrush(Colors.Red);
                stumings.HorizontalAlignment = HorizontalAlignment.Right;
                stumings.Margin = new Thickness(280, -30, 0, 0);
                stumings.FontSize = 24;
                TextBlock stumings_content = new TextBlock();
                stumings_content.Text = "STUMINGS";
                stumings_content.FontSize = 24;
                stumings_content.Foreground = new SolidColorBrush(Colors.Red);
                stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_stumin = new StackPanel();
                stk_stumin.Height = 50;
                stk_stumin.Children.Add(stumings_content);
                stk_stumin.Children.Add(stumings);

                TextBlock hundreds = new TextBlock();
                hundreds.Text = batting_cl.ElementAt(0).hundreds;
                hundreds.FontSize = 24;
                hundreds.Foreground = new SolidColorBrush(Colors.Blue);
                hundreds.HorizontalAlignment = HorizontalAlignment.Right;
                hundreds.Margin = new Thickness(280, -30, 0, 0);
                TextBlock hundreds_cotent = new TextBlock();
                hundreds_cotent.Text = "100'S";
                hundreds_cotent.FontSize = 24;
                hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
                hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_hundr = new StackPanel();
                stk_hundr.Height = 50;
                stk_hundr.Children.Add(hundreds_cotent);
                stk_hundr.Children.Add(hundreds);



                TextBlock average = new TextBlock();
                average.Text = batting_cl.ElementAt(0).average;
                average.FontSize = 24;
                average.Foreground = new SolidColorBrush(Colors.Black);
                average.HorizontalAlignment = HorizontalAlignment.Right;
                average.Margin = new Thickness(280, -30, 0, 0);
                TextBlock average_content = new TextBlock();
                average_content.Text = "AVERAGE";
                average_content.FontSize = 24;
                average_content.Foreground = new SolidColorBrush(Colors.Black);
                average_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_aver = new StackPanel();
                stk_aver.Height = 50;
                stk_aver.Children.Add(average_content);
                stk_aver.Children.Add(average);





                items.HorizontalAlignment = HorizontalAlignment.Center;
                items.Items.Add(stk_matchtype);
                items.Items.Add(stk_match);
                //    items.Items.Add(matches);
                items.Items.Add(stk_inn);
                //  items.Items.Add(matchtype);
                //   items.Items.Add(innings);

                items.Items.Add(stk_not);
                items.Items.Add(stk_runs);
                items.Items.Add(stk_high);
                items.Items.Add(stk_balls);
                items.Items.Add(stk_six);

                //  items.Items.Add(runsscored);
                //  items.Items.Add(ballstaken);
                // items.Items.Add(sixes);
                items.Items.Add(stk_four);
                items.Items.Add(stk_fifty);
                items.Items.Add(stk_ducks);
                items.Items.Add(stk_catch);
                items.Items.Add(stk_stumin);
                items.Items.Add(stk_hundr);
                items.Items.Add(stk_aver);

                // items.Items.Add(fours);
                // items.Items.Add(ducks);
                // items.Items.Add(fifties);
                // items.Items.Add(catches);
                //  items.Items.Add(stumings);
                //  items.Items.Add(hundreds);
                //  items.Items.Add(average);
                stk.Children.Add(items);


                /*
                stk.Children.Add(matches);
                stk.Children.Add(matchtype);
                stk.Children.Add(innings);
                stk.Children.Add(notout);
                stk.Children.Add(runsscored);
                stk.Children.Add(ballstaken);
                stk.Children.Add(sixes);
                stk.Children.Add(fours);
                stk.Children.Add(ducks);
                stk.Children.Add(fifties);
                stk.Children.Add(catches);
                stk.Children.Add(stumings);
                stk.Children.Add(hundreds);
                stk.Children.Add(average); */
                br.Child = stk;
                batting.Child = br;
                batting.IsOpen = true;
            }
            catch (Exception kk)
            {
                MessageBox.Show("Data is Not Available");
            }
 
        }
        Popup personalinfo = new Popup();
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                button2.Background = new SolidColorBrush(Colors.Black);
                button3.Background = new SolidColorBrush(Colors.Black);
                button4.Background = new SolidColorBrush(Colors.Black);
                button1.Background = new SolidColorBrush(Colors.Brown);
                personalinfo.IsOpen = true;
                bowling.IsOpen = false;
                batting.IsOpen = false;
                career.IsOpen = false;
                Border br_pers = new Border();
                br_pers.BorderThickness = new Thickness(3.0);
                br_pers.Margin = new Thickness(20, 200, 0, 0);
                StackPanel stk_personal_info = new StackPanel();
                stk_personal_info.Height = 500;
                stk_personal_info.Width = 450;
                TextBlock fullname = new TextBlock();
                fullname.Text = info_player.ElementAt(0).fullname;
                fullname.FontSize = 28;
                fullname.TextWrapping = TextWrapping.Wrap;
                fullname.Foreground = new SolidColorBrush(Colors.Black);
                fullname.Margin = new Thickness(150, -30, 0, 0);
                fullname.HorizontalAlignment = HorizontalAlignment.Left;
                TextBlock fullname_content = new TextBlock();
                fullname_content.Text = "PLAYER NAME";
                fullname_content.FontSize = 22;
                fullname_content.HorizontalAlignment = HorizontalAlignment.Left;
                fullname_content.Foreground = new SolidColorBrush(Colors.Blue);
                Image img = new Image();
                try
                {
                    img.Source = new BitmapImage(new Uri(info_player.ElementAt(0).profile_image));
                }
                catch (Exception imag)
                {
                }
                img.Height = 200;
                img.Width = 200;
                img.Margin = new Thickness(300, 0, 0, 0);
                img.HorizontalAlignment = HorizontalAlignment.Center;
                TextBlock team = new TextBlock();
                team.Text = info_player.ElementAt(0).majorteam;
                team.FontSize = 24;
                team.Margin = new Thickness(150, -176, 0, 0);
                team.Foreground = new SolidColorBrush(Colors.Black);
                team.HorizontalAlignment = HorizontalAlignment.Left;
                TextBlock team_content = new TextBlock();
                team_content.Text = "TEAM    ";
                team_content.FontSize = 24;
                team_content.Margin = new Thickness(0, -180, 0, 0);
                team_content.Foreground = new SolidColorBrush(Colors.Blue);
                team_content.HorizontalAlignment = HorizontalAlignment.Left;
                TextBlock nickname = new TextBlock();
                nickname.Text = info_player.ElementAt(0).nickname;
                nickname.FontSize = 24;
                nickname.TextWrapping = TextWrapping.Wrap;
                nickname.Foreground = new SolidColorBrush(Colors.Black);
                nickname.HorizontalAlignment = HorizontalAlignment.Left;
                nickname.Margin = new Thickness(150, -130, 0, 0);
                TextBlock nickname_content = new TextBlock();
                nickname_content.Text = "NICKNAME ";
                nickname_content.FontSize = 24;
                nickname_content.Foreground = new SolidColorBrush(Colors.Blue);
                nickname_content.HorizontalAlignment = HorizontalAlignment.Left;
                nickname_content.Margin = new Thickness(0, -130, 0, 0);
                TextBlock shortname = new TextBlock();
                shortname.Text = info_player.ElementAt(0).shortname;
                shortname.FontSize = 34;
                shortname.Foreground = new SolidColorBrush(Colors.Black);
                shortname.HorizontalAlignment = HorizontalAlignment.Center;
                shortname.Margin = new Thickness(0, -80, 0, 0);
                TextBlock shortname_content = new TextBlock();
                shortname_content.Text = "SHORT NAME ";
                shortname_content.FontSize = 24;
                shortname_content.Foreground = new SolidColorBrush(Colors.Blue);
                shortname_content.HorizontalAlignment = HorizontalAlignment.Left;
                shortname_content.Margin = new Thickness(0, -80, 0, 0);
                TextBlock dateofbi = new TextBlock();
                dateofbi.Text = info_player.ElementAt(0).dateofbirth;
                dateofbi.FontSize = 24;
                dateofbi.Foreground = new SolidColorBrush(Colors.Black);
                dateofbi.HorizontalAlignment = HorizontalAlignment.Left;
                dateofbi.Margin = new Thickness(150, -65, 0, 0);
                TextBlock date_content = new TextBlock();
                date_content.Text = "D.O.B   ";
                date_content.FontSize = 24;
                date_content.Foreground = new SolidColorBrush(Colors.Blue);
                date_content.HorizontalAlignment = HorizontalAlignment.Left;
                date_content.Margin = new Thickness(0, -65, 0, 0);
                TextBlock battingstyle = new TextBlock();
                battingstyle.Text = info_player.ElementAt(0).battingstyle;
                battingstyle.FontSize = 24;
                battingstyle.Foreground = new SolidColorBrush(Colors.Black);
                battingstyle.HorizontalAlignment = HorizontalAlignment.Left;
                battingstyle.Margin = new Thickness(190, -30, 0, 0);
                TextBlock battingstyle_content = new TextBlock();
                battingstyle_content.Text = "BATTING STYLE ";
                battingstyle_content.FontSize = 24;
                battingstyle_content.Foreground = new SolidColorBrush(Colors.Blue);
                battingstyle_content.HorizontalAlignment = HorizontalAlignment.Left;
                battingstyle_content.Margin = new Thickness(0, 10, 0, 0);
                TextBlock bowling1 = new TextBlock();
                bowling1.Text = info_player.ElementAt(0).bowlingstyle;
                bowling1.FontSize = 24;
                bowling1.Foreground = new SolidColorBrush(Colors.Black);
                bowling1.HorizontalAlignment = HorizontalAlignment.Left;
                bowling1.Margin = new Thickness(190, -30, 0, 0);
                TextBlock bowling_content = new TextBlock();
                bowling_content.Text = "BOWLING STYLE ";
                bowling_content.FontSize = 24;
                bowling_content.Foreground = new SolidColorBrush(Colors.Blue);
                bowling_content.Margin = new Thickness(0, 20, 0, 0);
                bowling_content.HorizontalAlignment = HorizontalAlignment.Left;

                TextBlock role = new TextBlock();
                role.Text = info_player.ElementAt(0).role;
                role.FontSize = 24;
                role.Foreground = new SolidColorBrush(Colors.Black);
                role.HorizontalAlignment = HorizontalAlignment.Left;
                role.Margin = new Thickness(190, -30, 0, 0);
                TextBlock role_content = new TextBlock();
                role_content.Text = "ROLE  ";
                role_content.FontSize = 24;
                role_content.Foreground = new SolidColorBrush(Colors.Blue);
                role_content.Margin = new Thickness(0, 20, 0, 0);
                role_content.HorizontalAlignment = HorizontalAlignment.Left;



                TextBlock teams_played = new TextBlock();
                teams_played.Text = info_player.ElementAt(0).teams_played_for;
                teams_played.FontSize = 24;
                teams_played.Foreground = new SolidColorBrush(Colors.Black);
                teams_played.HorizontalAlignment = HorizontalAlignment.Left;
                teams_played.Margin = new Thickness(190, -30, 0, 0);
                teams_played.TextWrapping = TextWrapping.Wrap;
                // teams_played.Width = 250;
                TextBlock teams_played_content = new TextBlock();
                teams_played_content.Text = "TEAMS PLAYED ";
                teams_played_content.FontSize = 24;
                teams_played_content.TextWrapping = TextWrapping.Wrap;
                teams_played_content.Foreground = new SolidColorBrush(Colors.Blue);
                teams_played_content.Margin = new Thickness(0, 20, 0, 0);
                teams_played_content.HorizontalAlignment = HorizontalAlignment.Left;



                stk_personal_info.Children.Add(fullname_content);
                stk_personal_info.Children.Add(fullname);
                stk_personal_info.Children.Add(img);
                stk_personal_info.Children.Add(team_content);
                stk_personal_info.Children.Add(team);
                stk_personal_info.Children.Add(nickname_content);
                stk_personal_info.Children.Add(nickname);
                // stk_personal_info.Children.Add(shortname_content);
                // stk_personal_info.Children.Add(shortname);
                stk_personal_info.Children.Add(date_content);
                stk_personal_info.Children.Add(dateofbi);
                stk_personal_info.Children.Add(battingstyle_content);
                stk_personal_info.Children.Add(battingstyle);
                stk_personal_info.Children.Add(bowling_content);
                stk_personal_info.Children.Add(bowling1);
                stk_personal_info.Children.Add(role_content);
                stk_personal_info.Children.Add(role);
                stk_personal_info.Children.Add(teams_played_content);
                stk_personal_info.Children.Add(teams_played);
                br_pers.Child = stk_personal_info;
                personalinfo.Child = br_pers;


            }
            catch (Exception aa)
            {
                MessageBox.Show("Please wait it is Loading and try again");
            }



        }
       public  Popup bowling = new Popup();
        Border brw = new Border();
        private void button3_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                button2.Background = new SolidColorBrush(Colors.Black);
                button3.Background = new SolidColorBrush(Colors.Brown);
                button4.Background = new SolidColorBrush(Colors.Black);
                button1.Background = new SolidColorBrush(Colors.Black);
                batting.IsOpen = false;
                personalinfo.IsOpen = false;
                career.IsOpen = false;
                ListBox items = new ListBox();
                // Border br = new Border();
                brw.BorderThickness = new Thickness(3.0);
                brw.BorderBrush = new SolidColorBrush(Colors.Cyan);
                brw.Margin = new Thickness(20, 200, 0, 0);
                StackPanel stk = new StackPanel();
                stk.Height = 580;
                stk.Width = 440;
                // stk.Background = new SolidColorBrush(Colors.LightGray);
                Button btn_bod = new Button();
                btn_bod.Content = "ODI";
                btn_bod.Name = "btn_odi";
                btn_bod.Height = 80;
                btn_bod.Width = 100;
                btn_bod.Margin = new Thickness(0, 0, 0, 0);
                btn_bod.BorderThickness = new Thickness(0);
                btn_bod.Background = new SolidColorBrush(Colors.DarkGray);
                btn_bod.Click += new RoutedEventHandler(btn_bod_Click);
                btn_bod.HorizontalAlignment = HorizontalAlignment.Left;
                Button btn_btest = new Button();
                btn_btest.Content = "TEST";
                btn_btest.Name = "btn_test";
                btn_btest.Height = 80;
                btn_btest.Width = 100;
                btn_btest.BorderThickness = new Thickness(0);
                btn_btest.Background = new SolidColorBrush(Colors.Brown);
                btn_btest.HorizontalAlignment = HorizontalAlignment.Center;
                btn_btest.Margin = new Thickness(-175, -80, 0, 0);
                btn_btest.Click += new RoutedEventHandler(btn_btest_Click);
                Button btn_bipl = new Button();
                btn_bipl.Content = "IPL";
                btn_bipl.Name = "btn_ipl";
                btn_bipl.Height = 80;
                btn_bipl.Width = 100;
                btn_bipl.BorderThickness = new Thickness(0);
                btn_bipl.Background = new SolidColorBrush(Colors.Brown);
                btn_bipl.HorizontalAlignment = HorizontalAlignment.Center;
                btn_bipl.Margin = new Thickness(15, -80, 0, 0);
                btn_bipl.Click += new RoutedEventHandler(btn_bipl_Click);
                Button btn_bt20 = new Button();
                btn_bt20.Content = "T20";
                btn_bt20.Name = "btn_t20";
                btn_bt20.Height = 80;
                btn_bt20.Width = 100;
                btn_bt20.BorderThickness = new Thickness(0);
                btn_bt20.Background = new SolidColorBrush(Colors.Brown);
                btn_bt20.HorizontalAlignment = HorizontalAlignment.Center;
                btn_bt20.Margin = new Thickness(200, -80, 0, 0);
                btn_bt20.Click += new RoutedEventHandler(btn_bt20_Click);
                Button btn_bcl = new Button();
                btn_bcl.Content = "CL";
                btn_bcl.Name = "btn_cl";
                btn_bcl.Height = 80;
                btn_bcl.Width = 90;
                btn_bcl.BorderThickness = new Thickness(0);
                btn_bcl.Background = new SolidColorBrush(Colors.Brown);
                btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
                btn_bcl.Margin = new Thickness(10, -80, 0, 0);
                btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
                stk.Children.Add(btn_bod);
                stk.Children.Add(btn_btest);
                stk.Children.Add(btn_bipl);
                stk.Children.Add(btn_bt20);
                stk.Children.Add(btn_bcl);
                items.Height = 480;
                items.Width = 400;


                TextBlock matches = new TextBlock();
                TextBlock matches_content = new TextBlock();
                StackPanel stk_match = new StackPanel();
                try
                {
                    matches.Text = bowling_odi.ElementAt(0).matches;
                    matches.FontSize = 24;
                    matches.HorizontalAlignment = HorizontalAlignment.Right;
                    matches.Foreground = new SolidColorBrush(Colors.Red);
                    matches.Margin = new Thickness(280, -30, 0, 0);

                    matches_content.Text = "MATCHES";
                    matches_content.FontSize = 24;
                    matches_content.Foreground = new SolidColorBrush(Colors.Red);
                    matches_content.HorizontalAlignment = HorizontalAlignment.Left;

                    stk_match.Height = 50;
                    stk_match.Children.Add(matches_content);
                    stk_match.Children.Add(matches);
                }
                catch (Exception dd)
                { }

                TextBlock innings = new TextBlock();

                innings.Text = bowling_odi.ElementAt(0).innings;
                innings.FontSize = 24;
                innings.HorizontalAlignment = HorizontalAlignment.Right;
                innings.Foreground = new SolidColorBrush(Colors.Blue);
                innings.Margin = new Thickness(280, -30, 0, 0);
                TextBlock innings_content = new TextBlock();
                innings_content.Text = "INNINGS";
                innings_content.FontSize = 24;
                innings_content.Foreground = new SolidColorBrush(Colors.Blue);
                innings_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_inn = new StackPanel();
                stk_inn.Height = 50;
                stk_inn.Children.Add(innings_content);
                stk_inn.Children.Add(innings);

                TextBlock matchtype = new TextBlock();
                matchtype.Text = bowling_odi.ElementAt(0).matchtype;
                matchtype.FontSize = 24;
                matchtype.HorizontalAlignment = HorizontalAlignment.Right;
                matchtype.Foreground = new SolidColorBrush(Colors.Blue);
                matchtype.Margin = new Thickness(280, -30, 0, 0);
                TextBlock matchtype_content = new TextBlock();
                matchtype_content.Text = "MATCH TYPE";
                matchtype_content.FontSize = 24;
                matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
                matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
                StackPanel stk_matchtype = new StackPanel();
                stk_matchtype.Height = 50;
                stk_matchtype.Children.Add(matchtype_content);
                stk_matchtype.Children.Add(matchtype);

                TextBlock notout = new TextBlock();
                notout.Text = bowling_odi.ElementAt(0).ballsbowled;
                notout.FontSize = 24;
                notout.HorizontalAlignment = HorizontalAlignment.Right;
                notout.Foreground = new SolidColorBrush(Colors.Magenta);

                notout.Margin = new Thickness(280, -30, 0, 0);
                TextBlock notout_content = new TextBlock();
                notout_content.Text = "BALLS BOWLED";
                notout_content.FontSize = 24;
                notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
                notout_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_not = new StackPanel();
                stk_not.Height = 50;
                stk_not.Children.Add(notout_content);
                stk_not.Children.Add(notout);



                TextBlock runsscored = new TextBlock();
                runsscored.Text = bowling_odi.ElementAt(0).runsgiven;
                runsscored.FontSize = 24;
                runsscored.HorizontalAlignment = HorizontalAlignment.Right;
                runsscored.Foreground = new SolidColorBrush(Colors.Black);
                runsscored.Margin = new Thickness(280, -30, 0, 0);

                TextBlock runsscored_content = new TextBlock();
                runsscored_content.Text = "RUNS GIVEN";
                runsscored_content.FontSize = 24;
                runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
                runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
                StackPanel stk_runs = new StackPanel();
                stk_runs.Height = 50;

                stk_runs.Children.Add(runsscored_content);
                stk_runs.Children.Add(runsscored);


                TextBlock highestscore = new TextBlock();
                highestscore.Text = bowling_odi.ElementAt(0).wickets;
                highestscore.FontSize = 24;
                highestscore.Margin = new Thickness(280, -30, 0, 0);
                highestscore.HorizontalAlignment = HorizontalAlignment.Right;
                highestscore.Foreground = new SolidColorBrush(Colors.Purple);

                TextBlock highestscore_content = new TextBlock();
                highestscore_content.Text = "WICKETS";
                highestscore_content.FontSize = 24;
                highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
                highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
                StackPanel stk_high = new StackPanel();
                stk_high.Height = 50;

                stk_high.Children.Add(highestscore_content);
                stk_high.Children.Add(highestscore);



                TextBlock ballstaken = new TextBlock();
                ballstaken.Text = bowling_odi.ElementAt(0).fourwicket;
                ballstaken.FontSize = 24;
                ballstaken.Foreground = new SolidColorBrush(Colors.Blue);
                ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
                ballstaken.Margin = new Thickness(280, -30, 0, 0);
                TextBlock ballstaken_content = new TextBlock();
                ballstaken_content.Text = "FOUR WICKET";
                ballstaken_content.FontSize = 24;
                ballstaken_content.Foreground = new SolidColorBrush(Colors.Blue);
                ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_balls = new StackPanel();
                stk_balls.Height = 50;
                stk_balls.Children.Add(ballstaken_content);
                stk_balls.Children.Add(ballstaken);





                TextBlock sixes = new TextBlock();
                sixes.Text = bowling_odi.ElementAt(0).fivewicket;
                sixes.FontSize = 24;
                sixes.Foreground = new SolidColorBrush(Colors.Cyan);
                sixes.HorizontalAlignment = HorizontalAlignment.Right;
                sixes.Margin = new Thickness(280, -30, 0, 0);
                TextBlock sixes_content = new TextBlock();
                sixes_content.Text = "FIVE WICKET";
                sixes_content.FontSize = 24;
                sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
                sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_six = new StackPanel();
                stk_six.Height = 50;
                stk_six.Children.Add(sixes_content);
                stk_six.Children.Add(sixes);


                TextBlock fours = new TextBlock();
                fours.Text = bowling_odi.ElementAt(0).tenwicket;
                fours.Foreground = new SolidColorBrush(Colors.Brown);
                fours.HorizontalAlignment = HorizontalAlignment.Right;
                fours.FontSize = 24;
                fours.Margin = new Thickness(280, -30, 0, 0);
                TextBlock fours_content = new TextBlock();
                fours_content.Text = "TEN WICKET";
                fours_content.FontSize = 24;
                fours_content.Foreground = new SolidColorBrush(Colors.Brown);
                fours_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_four = new StackPanel();
                stk_four.Height = 50;
                stk_four.Children.Add(fours_content);
                stk_four.Children.Add(fours);


                TextBlock ducks = new TextBlock();
                ducks.Text = bowling_odi.ElementAt(0).bestbowlinginInnings;
                ducks.FontSize = 24;
                ducks.Foreground = new SolidColorBrush(Colors.Black);
                ducks.HorizontalAlignment = HorizontalAlignment.Right;
                ducks.Margin = new Thickness(280, -30, 0, 0);
                TextBlock ducks_content = new TextBlock();
                ducks_content.Text = "BEST BOWLING INNINGS";
                ducks_content.FontSize = 24;
                ducks_content.Foreground = new SolidColorBrush(Colors.Black);
                ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_ducks = new StackPanel();
                stk_ducks.Height = 50;
                stk_ducks.Children.Add(ducks_content);
                stk_ducks.Children.Add(ducks);




                TextBlock fifties = new TextBlock();
                fifties.Text = bowling_odi.ElementAt(0).bestbowlinginMatch;
                fifties.FontSize = 24;
                fifties.HorizontalAlignment = HorizontalAlignment.Right;
                fifties.Foreground = new SolidColorBrush(Colors.Green);
                fifties.Margin = new Thickness(280, -30, 0, 0);
                TextBlock fifties_content = new TextBlock();
                fifties_content.Text = "BEST BOWLING MATCH";
                fifties_content.FontSize = 24;
                fifties_content.Foreground = new SolidColorBrush(Colors.Green);
                fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_fifty = new StackPanel();
                stk_fifty.Height = 50;
                stk_fifty.Children.Add(fifties_content);
                stk_fifty.Children.Add(fifties);


                TextBlock catches = new TextBlock();
                catches.Text = bowling_odi.ElementAt(0).economyrate;
                catches.FontSize = 24;
                catches.Foreground = new SolidColorBrush(Colors.Purple);
                catches.HorizontalAlignment = HorizontalAlignment.Right;
                catches.Margin = new Thickness(280, -30, 0, 0);
                TextBlock catches_content = new TextBlock();
                catches_content.Text = "ECONOMY RATE";
                catches_content.FontSize = 24;
                catches_content.Foreground = new SolidColorBrush(Colors.Purple);
                catches_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_catch = new StackPanel();
                stk_catch.Height = 50;
                stk_catch.Children.Add(catches_content);
                stk_catch.Children.Add(catches);



                TextBlock stumings = new TextBlock();
                stumings.Text = bowling_odi.ElementAt(0).strikerate;
                stumings.Foreground = new SolidColorBrush(Colors.Red);
                stumings.HorizontalAlignment = HorizontalAlignment.Right;
                stumings.Margin = new Thickness(280, -30, 0, 0);
                stumings.FontSize = 24;
                TextBlock stumings_content = new TextBlock();
                stumings_content.Text = "STRIKE RATE";
                stumings_content.FontSize = 24;
                stumings_content.Foreground = new SolidColorBrush(Colors.Red);
                stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_stumin = new StackPanel();
                stk_stumin.Height = 50;
                stk_stumin.Children.Add(stumings_content);
                stk_stumin.Children.Add(stumings);

                TextBlock hundreds = new TextBlock();
                hundreds.Text = bowling_odi.ElementAt(0).average;
                hundreds.FontSize = 24;
                hundreds.Foreground = new SolidColorBrush(Colors.Blue);
                hundreds.HorizontalAlignment = HorizontalAlignment.Right;
                hundreds.Margin = new Thickness(280, -30, 0, 0);
                TextBlock hundreds_cotent = new TextBlock();
                hundreds_cotent.Text = "AVERAGE";
                hundreds_cotent.FontSize = 24;
                hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
                hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_hundr = new StackPanel();
                stk_hundr.Height = 50;
                stk_hundr.Children.Add(hundreds_cotent);
                stk_hundr.Children.Add(hundreds);

                /*

                TextBlock average = new TextBlock();
                average.Text = batting_odi.ElementAt(0).average;
                average.FontSize = 24;
                average.Foreground = new SolidColorBrush(Colors.Gray);
                average.HorizontalAlignment = HorizontalAlignment.Right;
                average.Margin = new Thickness(280, -30, 0, 0);
                TextBlock average_content = new TextBlock();
                average_content.Text = "AVERAGE";
                average_content.FontSize = 24;
                average_content.Foreground = new SolidColorBrush(Colors.Gray);
                average_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_aver = new StackPanel();
                stk_aver.Height = 50;
                stk_aver.Children.Add(average_content);
                stk_aver.Children.Add(average);


                */


                items.HorizontalAlignment = HorizontalAlignment.Center;
                items.Items.Add(stk_matchtype);
                items.Items.Add(stk_match);
                //    items.Items.Add(matches);
                items.Items.Add(stk_inn);
                //  items.Items.Add(matchtype);
                //   items.Items.Add(innings);

                items.Items.Add(stk_not);
                items.Items.Add(stk_runs);
                items.Items.Add(stk_high);
                items.Items.Add(stk_balls);
                items.Items.Add(stk_six);

                //  items.Items.Add(runsscored);
                //  items.Items.Add(ballstaken);
                // items.Items.Add(sixes);
                items.Items.Add(stk_four);
                items.Items.Add(stk_fifty);
                items.Items.Add(stk_ducks);
                items.Items.Add(stk_catch);
                items.Items.Add(stk_stumin);
                items.Items.Add(stk_hundr);
                // items.Items.Add(stk_aver);

                // items.Items.Add(fours);
                // items.Items.Add(ducks);
                // items.Items.Add(fifties);
                // items.Items.Add(catches);
                //  items.Items.Add(stumings);
                //  items.Items.Add(hundreds);
                //  items.Items.Add(average);
                stk.Children.Add(items);


                /*
                stk.Children.Add(matches);
                stk.Children.Add(matchtype);
                stk.Children.Add(innings);
                stk.Children.Add(notout);
                stk.Children.Add(runsscored);
                stk.Children.Add(ballstaken);
                stk.Children.Add(sixes);
                stk.Children.Add(fours);
                stk.Children.Add(ducks);
                stk.Children.Add(fifties);
                stk.Children.Add(catches);
                stk.Children.Add(stumings);
                stk.Children.Add(hundreds);
                stk.Children.Add(average); */
                brw.Child = stk;
                bowling.Child = brw;
                bowling.IsOpen = true;

            }
            catch (Exception ee)
            {
                MessageBox.Show("Please wait it is Loading");
            }



        }
        private void btn_bod_Click(object sender, RoutedEventArgs e)
        {
            batting.IsOpen = false;
            personalinfo.IsOpen = false;

            ListBox items = new ListBox();
            // Border br = new Border();
            brw.BorderThickness = new Thickness(3.0);
            brw.BorderBrush = new SolidColorBrush(Colors.Green);
            brw.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_bod = new Button();
            btn_bod.Content = "ODI";
            btn_bod.Name = "btn_odi";
            btn_bod.Height = 80;
            btn_bod.Width = 100;
            btn_bod.BorderThickness = new Thickness(0);
            btn_bod.Background = new SolidColorBrush(Colors.DarkGray);
            btn_bod.Margin = new Thickness(0, 0, 0, 0);
            btn_bod.Click += new RoutedEventHandler(btn_bod_Click);
            btn_bod.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_btest = new Button();
            btn_btest.Content = "TEST";
            btn_btest.Name = "btn_test";
            btn_btest.Height = 80;
            btn_btest.Width = 100;
            btn_btest.BorderThickness = new Thickness(0);
            btn_btest.Background = new SolidColorBrush(Colors.Brown);
            btn_btest.HorizontalAlignment = HorizontalAlignment.Center;
            btn_btest.Margin = new Thickness(-175, -80, 0, 0);
            btn_btest.Click += new RoutedEventHandler(btn_btest_Click);
            Button btn_bipl = new Button();
            btn_bipl.Content = "IPL";
            btn_bipl.Name = "btn_ipl";
            btn_bipl.Height = 80;
            btn_bipl.Width = 100;
            btn_bipl.BorderThickness = new Thickness(0);
            btn_bipl.Background = new SolidColorBrush(Colors.Brown);
            btn_bipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bipl.Margin = new Thickness(15, -80, 0, 0);
            btn_bipl.Click += new RoutedEventHandler(btn_bipl_Click);
            Button btn_bt20 = new Button();
            btn_bt20.Content = "T20";
            btn_bt20.Name = "btn_t20";
            btn_bt20.Height = 80;
            btn_bt20.Width = 100;
            btn_bt20.BorderThickness = new Thickness(0);
            btn_bt20.Background = new SolidColorBrush(Colors.Brown);
            btn_bt20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bt20.Margin = new Thickness(200, -80, 0, 0);
            btn_bt20.Click += new RoutedEventHandler(btn_bt20_Click);
            Button btn_bcl = new Button();
            btn_bcl.Content = "CL";
            btn_bcl.Name = "btn_cl";
            btn_bcl.Height = 80;
            btn_bcl.Width = 90;
            btn_bcl.BorderThickness = new Thickness(0);
            btn_bcl.Background = new SolidColorBrush(Colors.Brown);
            btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_bcl.Margin = new Thickness(10, -80, 0, 0);
            btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
            stk.Children.Add(btn_bod);
            stk.Children.Add(btn_btest);
            stk.Children.Add(btn_bipl);
            stk.Children.Add(btn_bt20);
            stk.Children.Add(btn_bcl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = bowling_odi.ElementAt(0).matches;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "MATCHES";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = bowling_odi.ElementAt(0).innings;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(280, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "INNINGS";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = bowling_odi.ElementAt(0).matchtype;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "MATCH TYPE";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = bowling_odi.ElementAt(0).ballsbowled;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(280, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "BALLS BOWLED";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = bowling_odi.ElementAt(0).runsgiven;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "RUNS GIVEN";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = bowling_odi.ElementAt(0).wickets;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "WICKETS";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);



            TextBlock ballstaken = new TextBlock();
            ballstaken.Text = bowling_odi.ElementAt(0).fourwicket;
            ballstaken.FontSize = 24;
            ballstaken.Foreground = new SolidColorBrush(Colors.Black);
            ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
            ballstaken.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ballstaken_content = new TextBlock();
            ballstaken_content.Text = "FOUR WICKET";
            ballstaken_content.FontSize = 24;
            ballstaken_content.Foreground = new SolidColorBrush(Colors.Black);
            ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_balls = new StackPanel();
            stk_balls.Height = 50;
            stk_balls.Children.Add(ballstaken_content);
            stk_balls.Children.Add(ballstaken);





            TextBlock sixes = new TextBlock();
            sixes.Text = bowling_odi.ElementAt(0).fivewicket;
            sixes.FontSize = 24;
            sixes.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes.HorizontalAlignment = HorizontalAlignment.Right;
            sixes.Margin = new Thickness(280, -30, 0, 0);
            TextBlock sixes_content = new TextBlock();
            sixes_content.Text = "FIVE WICKET";
            sixes_content.FontSize = 24;
            sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_six = new StackPanel();
            stk_six.Height = 50;
            stk_six.Children.Add(sixes_content);
            stk_six.Children.Add(sixes);


            TextBlock fours = new TextBlock();
            fours.Text = bowling_odi.ElementAt(0).tenwicket;
            fours.Foreground = new SolidColorBrush(Colors.Brown);
            fours.HorizontalAlignment = HorizontalAlignment.Right;
            fours.FontSize = 24;
            fours.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fours_content = new TextBlock();
            fours_content.Text = "TEN WICKET";
            fours_content.FontSize = 24;
            fours_content.Foreground = new SolidColorBrush(Colors.Brown);
            fours_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_four = new StackPanel();
            stk_four.Height = 50;
            stk_four.Children.Add(fours_content);
            stk_four.Children.Add(fours);


            TextBlock ducks = new TextBlock();
            ducks.Text = bowling_odi.ElementAt(0).bestbowlinginInnings;
            ducks.FontSize = 24;
            ducks.Foreground = new SolidColorBrush(Colors.Blue);
            ducks.HorizontalAlignment = HorizontalAlignment.Right;
            ducks.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ducks_content = new TextBlock();
            ducks_content.Text = "BEST BOWLING INNINGS";
            ducks_content.FontSize = 24;
            ducks_content.Foreground = new SolidColorBrush(Colors.Blue);
            ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_ducks = new StackPanel();
            stk_ducks.Height = 50;
            stk_ducks.Children.Add(ducks_content);
            stk_ducks.Children.Add(ducks);




            TextBlock fifties = new TextBlock();
            fifties.Text = bowling_odi.ElementAt(0).bestbowlinginMatch;
            fifties.FontSize = 24;
            fifties.HorizontalAlignment = HorizontalAlignment.Right;
            fifties.Foreground = new SolidColorBrush(Colors.Green);
            fifties.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fifties_content = new TextBlock();
            fifties_content.Text = "BEST BOWLING MATCH";
            fifties_content.FontSize = 24;
            fifties_content.Foreground = new SolidColorBrush(Colors.Green);
            fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_fifty = new StackPanel();
            stk_fifty.Height = 50;
            stk_fifty.Children.Add(fifties_content);
            stk_fifty.Children.Add(fifties);


            TextBlock catches = new TextBlock();
            catches.Text = bowling_odi.ElementAt(0).economyrate;
            catches.FontSize = 24;
            catches.Foreground = new SolidColorBrush(Colors.Purple);
            catches.HorizontalAlignment = HorizontalAlignment.Right;
            catches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock catches_content = new TextBlock();
            catches_content.Text = "ECONOMY RATE";
            catches_content.FontSize = 24;
            catches_content.Foreground = new SolidColorBrush(Colors.Purple);
            catches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_catch = new StackPanel();
            stk_catch.Height = 50;
            stk_catch.Children.Add(catches_content);
            stk_catch.Children.Add(catches);



            TextBlock stumings = new TextBlock();
            stumings.Text = bowling_odi.ElementAt(0).strikerate;
            stumings.Foreground = new SolidColorBrush(Colors.Red);
            stumings.HorizontalAlignment = HorizontalAlignment.Right;
            stumings.Margin = new Thickness(280, -30, 0, 0);
            stumings.FontSize = 24;
            TextBlock stumings_content = new TextBlock();
            stumings_content.Text = "STRIKE RATE";
            stumings_content.FontSize = 24;
            stumings_content.Foreground = new SolidColorBrush(Colors.Red);
            stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_stumin = new StackPanel();
            stk_stumin.Height = 50;
            stk_stumin.Children.Add(stumings_content);
            stk_stumin.Children.Add(stumings);

            TextBlock hundreds = new TextBlock();
            hundreds.Text = bowling_odi.ElementAt(0).average;
            hundreds.FontSize = 24;
            hundreds.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds.HorizontalAlignment = HorizontalAlignment.Right;
            hundreds.Margin = new Thickness(280, -30, 0, 0);
            TextBlock hundreds_cotent = new TextBlock();
            hundreds_cotent.Text = "AVERAGE";
            hundreds_cotent.FontSize = 24;
            hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_hundr = new StackPanel();
            stk_hundr.Height = 50;
            stk_hundr.Children.Add(hundreds_cotent);
            stk_hundr.Children.Add(hundreds);

            /*

            TextBlock average = new TextBlock();
            average.Text = batting_odi.ElementAt(0).average;
            average.FontSize = 24;
            average.Foreground = new SolidColorBrush(Colors.Gray);
            average.HorizontalAlignment = HorizontalAlignment.Right;
            average.Margin = new Thickness(280, -30, 0, 0);
            TextBlock average_content = new TextBlock();
            average_content.Text = "AVERAGE";
            average_content.FontSize = 24;
            average_content.Foreground = new SolidColorBrush(Colors.Gray);
            average_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_aver = new StackPanel();
            stk_aver.Height = 50;
            stk_aver.Children.Add(average_content);
            stk_aver.Children.Add(average);


            */


            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            items.Items.Add(stk_balls);
            items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            items.Items.Add(stk_four);
            items.Items.Add(stk_fifty);
            items.Items.Add(stk_ducks);
            items.Items.Add(stk_catch);
            items.Items.Add(stk_stumin);
            items.Items.Add(stk_hundr);
            // items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);


            /*
            stk.Children.Add(matches);
            stk.Children.Add(matchtype);
            stk.Children.Add(innings);
            stk.Children.Add(notout);
            stk.Children.Add(runsscored);
            stk.Children.Add(ballstaken);
            stk.Children.Add(sixes);
            stk.Children.Add(fours);
            stk.Children.Add(ducks);
            stk.Children.Add(fifties);
            stk.Children.Add(catches);
            stk.Children.Add(stumings);
            stk.Children.Add(hundreds);
            stk.Children.Add(average); */
            brw.Child = stk;
            bowling.Child = brw;
            bowling.IsOpen = true;
 
        }
        private void btn_btest_Click(object sender, RoutedEventArgs e)
        {
            batting.IsOpen = false;
            personalinfo.IsOpen = false;

            ListBox items = new ListBox();
            // Border br = new Border();
            brw.BorderThickness = new Thickness(3.0);
            brw.BorderBrush = new SolidColorBrush(Colors.Green);
            brw.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_bod = new Button();
            btn_bod.Content = "ODI";
            btn_bod.Name = "btn_odi";
            btn_bod.Height = 80;
            btn_bod.Width = 100;
            btn_bod.BorderThickness = new Thickness(0);
            btn_bod.Background = new SolidColorBrush(Colors.Brown);
            btn_bod.Margin = new Thickness(0, 0, 0, 0);
            btn_bod.Click += new RoutedEventHandler(btn_bod_Click);
            btn_bod.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_btest = new Button();
            btn_btest.Content = "TEST";
            btn_btest.Name = "btn_test";
            btn_btest.Height = 80;
            btn_btest.Width = 100;
            btn_btest.BorderThickness = new Thickness(0);
            btn_btest.Background = new SolidColorBrush(Colors.DarkGray);
            btn_btest.HorizontalAlignment = HorizontalAlignment.Center;
            btn_btest.Margin = new Thickness(-175, -80, 0, 0);
            btn_btest.Click += new RoutedEventHandler(btn_btest_Click);
            Button btn_bipl = new Button();
            btn_bipl.Content = "IPL";
            btn_bipl.Name = "btn_ipl";
            btn_bipl.Height = 80;
            btn_bipl.Width = 100;
            btn_bipl.BorderThickness = new Thickness(0);
            btn_bipl.Background = new SolidColorBrush(Colors.Brown);
            btn_bipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bipl.Margin = new Thickness(15, -80, 0, 0);
            btn_bipl.Click += new RoutedEventHandler(btn_bipl_Click);
            Button btn_bt20 = new Button();
            btn_bt20.Content = "T20";
            btn_bt20.Name = "btn_t20";
            btn_bt20.Height = 80;
            btn_bt20.Width = 100;
            btn_bt20.BorderThickness = new Thickness(0);
            btn_bt20.Background = new SolidColorBrush(Colors.Brown);
            btn_bt20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bt20.Margin = new Thickness(200, -80, 0, 0);
            btn_bt20.Click += new RoutedEventHandler(btn_bt20_Click);
            Button btn_bcl = new Button();
            btn_bcl.Content = "CL";
            btn_bcl.Name = "btn_cl";
            btn_bcl.Height = 80;
            btn_bcl.Width = 90;
            btn_bcl.BorderThickness = new Thickness(0);
            btn_bcl.Background = new SolidColorBrush(Colors.Brown);
            btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_bcl.Margin = new Thickness(10, -80, 0, 0);
            btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
            stk.Children.Add(btn_bod);
            stk.Children.Add(btn_btest);
            stk.Children.Add(btn_bipl);
            stk.Children.Add(btn_bt20);
            stk.Children.Add(btn_bcl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = bowling_test.ElementAt(0).matches;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "MATCHES";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = bowling_test.ElementAt(0).innings;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(280, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "INNINGS";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = bowling_test.ElementAt(0).matchtype;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Green);
            matchtype.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "MATCH TYPE";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Green);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = bowling_test.ElementAt(0).ballsbowled;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(280, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "BALLS BOWLED";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = bowling_test.ElementAt(0).runsgiven;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "RUNS GIVEN";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = bowling_test.ElementAt(0).wickets;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "WICKETS";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);



            TextBlock ballstaken = new TextBlock();
            ballstaken.Text = bowling_test.ElementAt(0).fourwicket;
            ballstaken.FontSize = 24;
            ballstaken.Foreground = new SolidColorBrush(Colors.Brown);
            ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
            ballstaken.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ballstaken_content = new TextBlock();
            ballstaken_content.Text = "FOUR WICKET";
            ballstaken_content.FontSize = 24;
            ballstaken_content.Foreground = new SolidColorBrush(Colors.Brown);
            ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_balls = new StackPanel();
            stk_balls.Height = 50;
            stk_balls.Children.Add(ballstaken_content);
            stk_balls.Children.Add(ballstaken);





            TextBlock sixes = new TextBlock();
            sixes.Text = bowling_test.ElementAt(0).fivewicket;
            sixes.FontSize = 24;
            sixes.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes.HorizontalAlignment = HorizontalAlignment.Right;
            sixes.Margin = new Thickness(280, -30, 0, 0);
            TextBlock sixes_content = new TextBlock();
            sixes_content.Text = "FIVE WICKET";
            sixes_content.FontSize = 24;
            sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_six = new StackPanel();
            stk_six.Height = 50;
            stk_six.Children.Add(sixes_content);
            stk_six.Children.Add(sixes);


            TextBlock fours = new TextBlock();
            fours.Text = bowling_test.ElementAt(0).tenwicket;
            fours.Foreground = new SolidColorBrush(Colors.Brown);
            fours.HorizontalAlignment = HorizontalAlignment.Right;
            fours.FontSize = 24;
            fours.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fours_content = new TextBlock();
            fours_content.Text = "TEN WICKET";
            fours_content.FontSize = 24;
            fours_content.Foreground = new SolidColorBrush(Colors.Brown);
            fours_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_four = new StackPanel();
            stk_four.Height = 50;
            stk_four.Children.Add(fours_content);
            stk_four.Children.Add(fours);


            TextBlock ducks = new TextBlock();
            ducks.Text = bowling_test.ElementAt(0).bestbowlinginInnings;
            ducks.FontSize = 24;
            ducks.Foreground = new SolidColorBrush(Colors.Black);
            ducks.HorizontalAlignment = HorizontalAlignment.Right;
            ducks.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ducks_content = new TextBlock();
            ducks_content.Text = "BEST BOWLING INNINGS";
            ducks_content.FontSize = 24;
            ducks_content.Foreground = new SolidColorBrush(Colors.Black);
            ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_ducks = new StackPanel();
            stk_ducks.Height = 50;
            stk_ducks.Children.Add(ducks_content);
            stk_ducks.Children.Add(ducks);




            TextBlock fifties = new TextBlock();
            fifties.Text = bowling_test.ElementAt(0).bestbowlinginMatch;
            fifties.FontSize = 24;
            fifties.HorizontalAlignment = HorizontalAlignment.Right;
            fifties.Foreground = new SolidColorBrush(Colors.Green);
            fifties.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fifties_content = new TextBlock();
            fifties_content.Text = "BEST BOWLING MATCH";
            fifties_content.FontSize = 24;
            fifties_content.Foreground = new SolidColorBrush(Colors.Green);
            fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_fifty = new StackPanel();
            stk_fifty.Height = 50;
            stk_fifty.Children.Add(fifties_content);
            stk_fifty.Children.Add(fifties);


            TextBlock catches = new TextBlock();
            catches.Text = bowling_test.ElementAt(0).economyrate;
            catches.FontSize = 24;
            catches.Foreground = new SolidColorBrush(Colors.Purple);
            catches.HorizontalAlignment = HorizontalAlignment.Right;
            catches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock catches_content = new TextBlock();
            catches_content.Text = "ECONOMY RATE";
            catches_content.FontSize = 24;
            catches_content.Foreground = new SolidColorBrush(Colors.Purple);
            catches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_catch = new StackPanel();
            stk_catch.Height = 50;
            stk_catch.Children.Add(catches_content);
            stk_catch.Children.Add(catches);



            TextBlock stumings = new TextBlock();
            stumings.Text = bowling_test.ElementAt(0).strikerate;
            stumings.Foreground = new SolidColorBrush(Colors.Red);
            stumings.HorizontalAlignment = HorizontalAlignment.Right;
            stumings.Margin = new Thickness(280, -30, 0, 0);
            stumings.FontSize = 24;
            TextBlock stumings_content = new TextBlock();
            stumings_content.Text = "STRIKE RATE";
            stumings_content.FontSize = 24;
            stumings_content.Foreground = new SolidColorBrush(Colors.Red);
            stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_stumin = new StackPanel();
            stk_stumin.Height = 50;
            stk_stumin.Children.Add(stumings_content);
            stk_stumin.Children.Add(stumings);

            TextBlock hundreds = new TextBlock();
            hundreds.Text = bowling_test.ElementAt(0).average;
            hundreds.FontSize = 24;
            hundreds.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds.HorizontalAlignment = HorizontalAlignment.Right;
            hundreds.Margin = new Thickness(280, -30, 0, 0);
            TextBlock hundreds_cotent = new TextBlock();
            hundreds_cotent.Text = "AVERAGE";
            hundreds_cotent.FontSize = 24;
            hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_hundr = new StackPanel();
            stk_hundr.Height = 50;
            stk_hundr.Children.Add(hundreds_cotent);
            stk_hundr.Children.Add(hundreds);

            /*

            TextBlock average = new TextBlock();
            average.Text = batting_odi.ElementAt(0).average;
            average.FontSize = 24;
            average.Foreground = new SolidColorBrush(Colors.Gray);
            average.HorizontalAlignment = HorizontalAlignment.Right;
            average.Margin = new Thickness(280, -30, 0, 0);
            TextBlock average_content = new TextBlock();
            average_content.Text = "AVERAGE";
            average_content.FontSize = 24;
            average_content.Foreground = new SolidColorBrush(Colors.Gray);
            average_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_aver = new StackPanel();
            stk_aver.Height = 50;
            stk_aver.Children.Add(average_content);
            stk_aver.Children.Add(average);


            */


            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            items.Items.Add(stk_balls);
            items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            items.Items.Add(stk_four);
            items.Items.Add(stk_fifty);
            items.Items.Add(stk_ducks);
            items.Items.Add(stk_catch);
            items.Items.Add(stk_stumin);
            items.Items.Add(stk_hundr);
            // items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);


            /*
            stk.Children.Add(matches);
            stk.Children.Add(matchtype);
            stk.Children.Add(innings);
            stk.Children.Add(notout);
            stk.Children.Add(runsscored);
            stk.Children.Add(ballstaken);
            stk.Children.Add(sixes);
            stk.Children.Add(fours);
            stk.Children.Add(ducks);
            stk.Children.Add(fifties);
            stk.Children.Add(catches);
            stk.Children.Add(stumings);
            stk.Children.Add(hundreds);
            stk.Children.Add(average); */
            brw.Child = stk;
            bowling.Child = brw;
            bowling.IsOpen = true;






        }
        private void btn_bt20_Click(object sender, RoutedEventArgs e)
        {
            batting.IsOpen = false;
            personalinfo.IsOpen = false;

            ListBox items = new ListBox();
            // Border br = new Border();
            brw.BorderThickness = new Thickness(3.0);
            brw.BorderBrush = new SolidColorBrush(Colors.Green);
            brw.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_bod = new Button();
            btn_bod.Content = "ODI";
            btn_bod.Name = "btn_odi";
            btn_bod.Height = 80;
            btn_bod.Width = 100;
            btn_bod.BorderThickness = new Thickness(0);
            btn_bod.Background = new SolidColorBrush(Colors.Brown);
            btn_bod.BorderThickness = new Thickness(0);
            btn_bod.Background = new SolidColorBrush(Colors.Brown);
            btn_bod.Margin = new Thickness(0, 0, 0, 0);
            btn_bod.Click += new RoutedEventHandler(btn_bod_Click);
            btn_bod.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_btest = new Button();
            btn_btest.Content = "TEST";
            btn_btest.Name = "btn_test";
            btn_btest.Height = 80;
            btn_btest.Width = 100;
            btn_btest.BorderThickness = new Thickness(0);
            btn_btest.Background = new SolidColorBrush(Colors.Brown);
            btn_btest.HorizontalAlignment = HorizontalAlignment.Center;
            btn_btest.Margin = new Thickness(-175, -80, 0, 0);
            btn_btest.Click += new RoutedEventHandler(btn_btest_Click);
            Button btn_bipl = new Button();
            btn_bipl.Content = "IPL";
            btn_bipl.Name = "btn_ipl";
            btn_bipl.Height = 80;
            btn_bipl.Width = 100;
            btn_bipl.BorderThickness = new Thickness(0);
            btn_bipl.Background = new SolidColorBrush(Colors.Brown);
            btn_bipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bipl.Margin = new Thickness(15, -80, 0, 0);
            btn_bipl.Click += new RoutedEventHandler(btn_bipl_Click);
            Button btn_bt20 = new Button();
            btn_bt20.Content = "T20";
            btn_bt20.Name = "btn_t20";
            btn_bt20.Height = 80;
            btn_bt20.Width = 100;
            btn_bt20.BorderThickness = new Thickness(0);
            btn_bt20.Background = new SolidColorBrush(Colors.DarkGray);
            btn_bt20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bt20.Margin = new Thickness(200, -80, 0, 0);
            btn_bt20.Click += new RoutedEventHandler(btn_bt20_Click);
            Button btn_bcl = new Button();
            btn_bcl.Content = "CL";
            btn_bcl.Name = "btn_cl";
            btn_bcl.Height = 80;
            btn_bcl.Width = 90;
            btn_bcl.BorderThickness = new Thickness(0);
            btn_bcl.Background = new SolidColorBrush(Colors.Brown);
            btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_bcl.Margin = new Thickness(10, -80, 0, 0);
            btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
            stk.Children.Add(btn_bod);
            stk.Children.Add(btn_btest);
            stk.Children.Add(btn_bipl);
            stk.Children.Add(btn_bt20);
            stk.Children.Add(btn_bcl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = bowling_t20.ElementAt(0).matches;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "MATCHES";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = bowling_t20.ElementAt(0).innings;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(280, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "INNINGS";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = bowling_t20.ElementAt(0).matchtype;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "MATCH TYPE";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = bowling_t20.ElementAt(0).ballsbowled;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(280, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "BALLS BOWLED";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = bowling_t20.ElementAt(0).runsgiven;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "RUNS GIVEN";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = bowling_t20.ElementAt(0).wickets;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "WICKETS";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);



            TextBlock ballstaken = new TextBlock();
            ballstaken.Text = bowling_t20.ElementAt(0).fourwicket;
            ballstaken.FontSize = 24;
            ballstaken.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
            ballstaken.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ballstaken_content = new TextBlock();
            ballstaken_content.Text = "FOUR WICKET";
            ballstaken_content.FontSize = 24;
            ballstaken_content.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_balls = new StackPanel();
            stk_balls.Height = 50;
            stk_balls.Children.Add(ballstaken_content);
            stk_balls.Children.Add(ballstaken);





            TextBlock sixes = new TextBlock();
            sixes.Text = bowling_t20.ElementAt(0).fivewicket;
            sixes.FontSize = 24;
            sixes.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes.HorizontalAlignment = HorizontalAlignment.Right;
            sixes.Margin = new Thickness(280, -30, 0, 0);
            TextBlock sixes_content = new TextBlock();
            sixes_content.Text = "FIVE WICKET";
            sixes_content.FontSize = 24;
            sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_six = new StackPanel();
            stk_six.Height = 50;
            stk_six.Children.Add(sixes_content);
            stk_six.Children.Add(sixes);


            TextBlock fours = new TextBlock();
            fours.Text = bowling_t20.ElementAt(0).tenwicket;
            fours.Foreground = new SolidColorBrush(Colors.Brown);
            fours.HorizontalAlignment = HorizontalAlignment.Right;
            fours.FontSize = 24;
            fours.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fours_content = new TextBlock();
            fours_content.Text = "TEN WICKET";
            fours_content.FontSize = 24;
            fours_content.Foreground = new SolidColorBrush(Colors.Brown);
            fours_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_four = new StackPanel();
            stk_four.Height = 50;
            stk_four.Children.Add(fours_content);
            stk_four.Children.Add(fours);


            TextBlock ducks = new TextBlock();
            ducks.Text = bowling_t20.ElementAt(0).bestbowlinginInnings;
            ducks.FontSize = 24;
            ducks.Foreground = new SolidColorBrush(Colors.Black);
            ducks.HorizontalAlignment = HorizontalAlignment.Right;
            ducks.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ducks_content = new TextBlock();
            ducks_content.Text = "BEST BOWLING INNINGS";
            ducks_content.FontSize = 24;
            ducks_content.Foreground = new SolidColorBrush(Colors.Black);
            ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_ducks = new StackPanel();
            stk_ducks.Height = 50;
            stk_ducks.Children.Add(ducks_content);
            stk_ducks.Children.Add(ducks);




            TextBlock fifties = new TextBlock();
            fifties.Text = bowling_t20.ElementAt(0).bestbowlinginMatch;
            fifties.FontSize = 24;
            fifties.HorizontalAlignment = HorizontalAlignment.Right;
            fifties.Foreground = new SolidColorBrush(Colors.Green);
            fifties.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fifties_content = new TextBlock();
            fifties_content.Text = "BEST BOWLING MATCH";
            fifties_content.FontSize = 24;
            fifties_content.Foreground = new SolidColorBrush(Colors.Green);
            fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_fifty = new StackPanel();
            stk_fifty.Height = 50;
            stk_fifty.Children.Add(fifties_content);
            stk_fifty.Children.Add(fifties);


            TextBlock catches = new TextBlock();
            catches.Text = bowling_t20.ElementAt(0).economyrate;
            catches.FontSize = 24;
            catches.Foreground = new SolidColorBrush(Colors.Purple);
            catches.HorizontalAlignment = HorizontalAlignment.Right;
            catches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock catches_content = new TextBlock();
            catches_content.Text = "ECONOMY RATE";
            catches_content.FontSize = 24;
            catches_content.Foreground = new SolidColorBrush(Colors.Purple);
            catches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_catch = new StackPanel();
            stk_catch.Height = 50;
            stk_catch.Children.Add(catches_content);
            stk_catch.Children.Add(catches);



            TextBlock stumings = new TextBlock();
            stumings.Text = bowling_t20.ElementAt(0).strikerate;
            stumings.Foreground = new SolidColorBrush(Colors.Red);
            stumings.HorizontalAlignment = HorizontalAlignment.Right;
            stumings.Margin = new Thickness(280, -30, 0, 0);
            stumings.FontSize = 24;
            TextBlock stumings_content = new TextBlock();
            stumings_content.Text = "STRIKE RATE";
            stumings_content.FontSize = 24;
            stumings_content.Foreground = new SolidColorBrush(Colors.Red);
            stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_stumin = new StackPanel();
            stk_stumin.Height = 50;
            stk_stumin.Children.Add(stumings_content);
            stk_stumin.Children.Add(stumings);

            TextBlock hundreds = new TextBlock();
            hundreds.Text = bowling_t20.ElementAt(0).average;
            hundreds.FontSize = 24;
            hundreds.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds.HorizontalAlignment = HorizontalAlignment.Right;
            hundreds.Margin = new Thickness(280, -30, 0, 0);
            TextBlock hundreds_cotent = new TextBlock();
            hundreds_cotent.Text = "AVERAGE";
            hundreds_cotent.FontSize = 24;
            hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_hundr = new StackPanel();
            stk_hundr.Height = 50;
            stk_hundr.Children.Add(hundreds_cotent);
            stk_hundr.Children.Add(hundreds);

            /*

            TextBlock average = new TextBlock();
            average.Text = batting_odi.ElementAt(0).average;
            average.FontSize = 24;
            average.Foreground = new SolidColorBrush(Colors.Gray);
            average.HorizontalAlignment = HorizontalAlignment.Right;
            average.Margin = new Thickness(280, -30, 0, 0);
            TextBlock average_content = new TextBlock();
            average_content.Text = "AVERAGE";
            average_content.FontSize = 24;
            average_content.Foreground = new SolidColorBrush(Colors.Gray);
            average_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_aver = new StackPanel();
            stk_aver.Height = 50;
            stk_aver.Children.Add(average_content);
            stk_aver.Children.Add(average);


            */


            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            items.Items.Add(stk_balls);
            items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            items.Items.Add(stk_four);
            items.Items.Add(stk_fifty);
            items.Items.Add(stk_ducks);
            items.Items.Add(stk_catch);
            items.Items.Add(stk_stumin);
            items.Items.Add(stk_hundr);
            // items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);


            /*
            stk.Children.Add(matches);
            stk.Children.Add(matchtype);
            stk.Children.Add(innings);
            stk.Children.Add(notout);
            stk.Children.Add(runsscored);
            stk.Children.Add(ballstaken);
            stk.Children.Add(sixes);
            stk.Children.Add(fours);
            stk.Children.Add(ducks);
            stk.Children.Add(fifties);
            stk.Children.Add(catches);
            stk.Children.Add(stumings);
            stk.Children.Add(hundreds);
            stk.Children.Add(average); */
            brw.Child = stk;
            bowling.Child = brw;
            bowling.IsOpen = true;


        }
        private void btn_bcl_Click(object sender, RoutedEventArgs e)
        {
            batting.IsOpen = false;
            personalinfo.IsOpen = false;

            ListBox items = new ListBox();
            // Border br = new Border();
            brw.BorderThickness = new Thickness(3.0);
            brw.BorderBrush = new SolidColorBrush(Colors.Green);
            brw.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_bod = new Button();
            btn_bod.Content = "ODI";
            btn_bod.Name = "btn_odi";
            btn_bod.Height = 80;
            btn_bod.Width = 100;
            btn_bod.BorderThickness = new Thickness(0);
            btn_bod.Background = new SolidColorBrush(Colors.Brown);
            btn_bod.Margin = new Thickness(0, 0, 0, 0);
            btn_bod.Click += new RoutedEventHandler(btn_bod_Click);
            btn_bod.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_btest = new Button();
            btn_btest.Content = "TEST";
            btn_btest.Name = "btn_test";
            btn_btest.Height = 80;
            btn_btest.Width = 100;
            btn_btest.BorderThickness = new Thickness(0);
            btn_btest.Background = new SolidColorBrush(Colors.Brown);
            btn_btest.HorizontalAlignment = HorizontalAlignment.Center;
            btn_btest.Margin = new Thickness(-175, -80, 0, 0);
            btn_btest.Click += new RoutedEventHandler(btn_btest_Click);
            Button btn_bipl = new Button();
            btn_bipl.Content = "IPL";
            btn_bipl.Name = "btn_ipl";
            btn_bipl.Height = 80;
            btn_bipl.Width = 100;
            btn_bipl.BorderThickness = new Thickness(0);
            btn_bipl.Background = new SolidColorBrush(Colors.Brown);
            btn_bipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bipl.Margin = new Thickness(15, -80, 0, 0);
            btn_bipl.Click += new RoutedEventHandler(btn_bipl_Click);
            Button btn_bt20 = new Button();
            btn_bt20.Content = "T20";
            btn_bt20.Name = "btn_t20";
            btn_bt20.Height = 80;
            btn_bt20.Width = 100;
            btn_bt20.BorderThickness = new Thickness(0);
            btn_bt20.Background = new SolidColorBrush(Colors.Brown);
            btn_bt20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bt20.Margin = new Thickness(200, -80, 0, 0);
            btn_bt20.Click += new RoutedEventHandler(btn_bt20_Click);
            Button btn_bcl = new Button();
            btn_bcl.Content = "CL";
            btn_bcl.Name = "btn_cl";
            btn_bcl.Height = 80;
            btn_bcl.Width = 90;
            btn_bcl.BorderThickness = new Thickness(0);
            btn_bcl.Background = new SolidColorBrush(Colors.DarkGray);
            btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_bcl.Margin = new Thickness(10, -80, 0, 0);
            btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
            stk.Children.Add(btn_bod);
            stk.Children.Add(btn_btest);
            stk.Children.Add(btn_bipl);
            stk.Children.Add(btn_bt20);
            stk.Children.Add(btn_bcl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = bowling_cl.ElementAt(0).matches;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "MATCHES";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = bowling_cl.ElementAt(0).innings;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(280, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "INNINGS";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = bowling_cl.ElementAt(0).matchtype;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(250, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "MATCH TYPE";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = bowling_cl.ElementAt(0).ballsbowled;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(280, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "BALLS BOWLED";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = bowling_cl.ElementAt(0).runsgiven;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "RUNS GIVEN";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = bowling_cl.ElementAt(0).wickets;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "WICKETS";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);



            TextBlock ballstaken = new TextBlock();
            ballstaken.Text = bowling_cl.ElementAt(0).fourwicket;
            ballstaken.FontSize = 24;
            ballstaken.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
            ballstaken.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ballstaken_content = new TextBlock();
            ballstaken_content.Text = "FOUR WICKET";
            ballstaken_content.FontSize = 24;
            ballstaken_content.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_balls = new StackPanel();
            stk_balls.Height = 50;
            stk_balls.Children.Add(ballstaken_content);
            stk_balls.Children.Add(ballstaken);





            TextBlock sixes = new TextBlock();
            sixes.Text = bowling_cl.ElementAt(0).fivewicket;
            sixes.FontSize = 24;
            sixes.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes.HorizontalAlignment = HorizontalAlignment.Right;
            sixes.Margin = new Thickness(280, -30, 0, 0);
            TextBlock sixes_content = new TextBlock();
            sixes_content.Text = "FIVE WICKET";
            sixes_content.FontSize = 24;
            sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_six = new StackPanel();
            stk_six.Height = 50;
            stk_six.Children.Add(sixes_content);
            stk_six.Children.Add(sixes);


            TextBlock fours = new TextBlock();
            fours.Text = bowling_cl.ElementAt(0).tenwicket;
            fours.Foreground = new SolidColorBrush(Colors.Brown);
            fours.HorizontalAlignment = HorizontalAlignment.Right;
            fours.FontSize = 24;
            fours.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fours_content = new TextBlock();
            fours_content.Text = "TEN WICKET";
            fours_content.FontSize = 24;
            fours_content.Foreground = new SolidColorBrush(Colors.Brown);
            fours_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_four = new StackPanel();
            stk_four.Height = 50;
            stk_four.Children.Add(fours_content);
            stk_four.Children.Add(fours);


            TextBlock ducks = new TextBlock();
            ducks.Text = bowling_cl.ElementAt(0).bestbowlinginInnings;
            ducks.FontSize = 24;
            ducks.Foreground = new SolidColorBrush(Colors.Black);
            ducks.HorizontalAlignment = HorizontalAlignment.Right;
            ducks.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ducks_content = new TextBlock();
            ducks_content.Text = "BEST BOWLING INNINGS";
            ducks_content.FontSize = 24;
            ducks_content.Foreground = new SolidColorBrush(Colors.Black);
            ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_ducks = new StackPanel();
            stk_ducks.Height = 50;
            stk_ducks.Children.Add(ducks_content);
            stk_ducks.Children.Add(ducks);




            TextBlock fifties = new TextBlock();
            fifties.Text = bowling_cl.ElementAt(0).bestbowlinginMatch;
            fifties.FontSize = 24;
            fifties.HorizontalAlignment = HorizontalAlignment.Right;
            fifties.Foreground = new SolidColorBrush(Colors.Green);
            fifties.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fifties_content = new TextBlock();
            fifties_content.Text = "BEST BOWLING MATCH";
            fifties_content.FontSize = 24;
            fifties_content.Foreground = new SolidColorBrush(Colors.Green);
            fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_fifty = new StackPanel();
            stk_fifty.Height = 50;
            stk_fifty.Children.Add(fifties_content);
            stk_fifty.Children.Add(fifties);
    /*

            TextBlock catches = new TextBlock();
            catches.Text = bowling_cl.ElementAt(0).economyrate;
            catches.FontSize = 24;
            catches.Foreground = new SolidColorBrush(Colors.Purple);
            catches.HorizontalAlignment = HorizontalAlignment.Right;
            catches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock catches_content = new TextBlock();
            catches_content.Text = "ECONOMY RATE";
            catches_content.FontSize = 24;
            catches_content.Foreground = new SolidColorBrush(Colors.Purple);
            catches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_catch = new StackPanel();
            stk_catch.Height = 50;
            stk_catch.Children.Add(catches_content);
            stk_catch.Children.Add(catches);



            TextBlock stumings = new TextBlock();
            stumings.Text = bowling_cl.ElementAt(0).strikerate;
            stumings.Foreground = new SolidColorBrush(Colors.Red);
            stumings.HorizontalAlignment = HorizontalAlignment.Right;
            stumings.Margin = new Thickness(280, -30, 0, 0);
            stumings.FontSize = 24;
            TextBlock stumings_content = new TextBlock();
            stumings_content.Text = "STRIKE RATE";
            stumings_content.FontSize = 24;
            stumings_content.Foreground = new SolidColorBrush(Colors.Red);
            stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_stumin = new StackPanel();
            stk_stumin.Height = 50;
            stk_stumin.Children.Add(stumings_content);
            stk_stumin.Children.Add(stumings);

            TextBlock hundreds = new TextBlock();
            hundreds.Text = bowling_cl.ElementAt(0).average;
            hundreds.FontSize = 24;
            hundreds.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds.HorizontalAlignment = HorizontalAlignment.Right;
            hundreds.Margin = new Thickness(280, -30, 0, 0);
            TextBlock hundreds_cotent = new TextBlock();
            hundreds_cotent.Text = "AVERAGE";
            hundreds_cotent.FontSize = 24;
            hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_hundr = new StackPanel();
            stk_hundr.Height = 50;
            stk_hundr.Children.Add(hundreds_cotent);
            stk_hundr.Children.Add(hundreds);
            */
            /*

            TextBlock average = new TextBlock();
            average.Text = batting_odi.ElementAt(0).average;
            average.FontSize = 24;
            average.Foreground = new SolidColorBrush(Colors.Gray);
            average.HorizontalAlignment = HorizontalAlignment.Right;
            average.Margin = new Thickness(280, -30, 0, 0);
            TextBlock average_content = new TextBlock();
            average_content.Text = "AVERAGE";
            average_content.FontSize = 24;
            average_content.Foreground = new SolidColorBrush(Colors.Gray);
            average_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_aver = new StackPanel();
            stk_aver.Height = 50;
            stk_aver.Children.Add(average_content);
            stk_aver.Children.Add(average);


            */


            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            items.Items.Add(stk_balls);
            items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            items.Items.Add(stk_four);
            items.Items.Add(stk_fifty);
            items.Items.Add(stk_ducks);
          //  items.Items.Add(stk_catch);
          //  items.Items.Add(stk_stumin);
         //   items.Items.Add(stk_hundr);
            // items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);


            /*
            stk.Children.Add(matches);
            stk.Children.Add(matchtype);
            stk.Children.Add(innings);
            stk.Children.Add(notout);
            stk.Children.Add(runsscored);
            stk.Children.Add(ballstaken);
            stk.Children.Add(sixes);
            stk.Children.Add(fours);
            stk.Children.Add(ducks);
            stk.Children.Add(fifties);
            stk.Children.Add(catches);
            stk.Children.Add(stumings);
            stk.Children.Add(hundreds);
            stk.Children.Add(average); */
            brw.Child = stk;
            bowling.Child = brw;
            bowling.IsOpen = true;


        }
        private void btn_bipl_Click(object sender, RoutedEventArgs e)
        {
            batting.IsOpen = false;
            personalinfo.IsOpen = false;

            ListBox items = new ListBox();
            // Border br = new Border();
            brw.BorderThickness = new Thickness(3.0);
            brw.BorderBrush = new SolidColorBrush(Colors.Green);
            brw.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_bod = new Button();
            btn_bod.Content = "ODI";
            btn_bod.Name = "btn_odi";
            btn_bod.Height = 80;
            btn_bod.Width = 100;
            btn_bod.BorderThickness = new Thickness(0);
            
            btn_bod.Background = new SolidColorBrush(Colors.Brown);
            btn_bod.Margin = new Thickness(0, 0, 0, 0);
            btn_bod.Click += new RoutedEventHandler(btn_bod_Click);
            btn_bod.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_btest = new Button();
            btn_btest.Content = "TEST";
            btn_btest.Name = "btn_test";
            btn_btest.Height = 80;
            btn_btest.Width = 100;
            btn_btest.BorderThickness = new Thickness(0);
            btn_btest.Background = new SolidColorBrush(Colors.Brown);
            btn_btest.HorizontalAlignment = HorizontalAlignment.Center;
            btn_btest.Margin = new Thickness(-175, -80, 0, 0);
            btn_btest.Click += new RoutedEventHandler(btn_btest_Click);
            Button btn_bipl = new Button();
            btn_bipl.Content = "IPL";
            btn_bipl.Name = "btn_ipl";
            btn_bipl.Height = 80;
            btn_bipl.Width = 100;
            btn_bipl.BorderThickness = new Thickness(0);
            btn_bipl.Background = new SolidColorBrush(Colors.DarkGray);
            btn_bipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bipl.Margin = new Thickness(15, -80, 0, 0);
            btn_bipl.Click += new RoutedEventHandler(btn_bipl_Click);
            Button btn_bt20 = new Button();
            btn_bt20.Content = "T20";
            btn_bt20.Name = "btn_t20";
            btn_bt20.Height = 80;
            btn_bt20.Width = 100;
            btn_bt20.BorderThickness = new Thickness(0);
            btn_bt20.Background = new SolidColorBrush(Colors.Brown);
            btn_bt20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_bt20.Margin = new Thickness(200, -80, 0, 0);
            btn_bt20.Click += new RoutedEventHandler(btn_bt20_Click);
            Button btn_bcl = new Button();
            btn_bcl.Content = "CL";
            btn_bcl.Name = "btn_cl";
            btn_bcl.Height = 80;
            btn_bcl.Width = 90;
            btn_bcl.BorderThickness = new Thickness(0);
            btn_bcl.Background = new SolidColorBrush(Colors.Brown);
            btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_bcl.Margin = new Thickness(10, -80, 0, 0);
            btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
            stk.Children.Add(btn_bod);
            stk.Children.Add(btn_btest);
            stk.Children.Add(btn_bipl);
            stk.Children.Add(btn_bt20);
            stk.Children.Add(btn_bcl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = bowling_ipl.ElementAt(0).matches;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "MATCHES";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = bowling_ipl.ElementAt(0).innings;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(280, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "INNINGS";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = bowling_ipl.ElementAt(0).matchtype;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(280, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "MATCH TYPE";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = bowling_ipl.ElementAt(0).ballsbowled;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(280, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "BALLS BOWLED";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = bowling_ipl.ElementAt(0).runsgiven;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "RUNS GIVEN";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = bowling_ipl.ElementAt(0).wickets;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "WICKETS";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);



            TextBlock ballstaken = new TextBlock();
            ballstaken.Text = bowling_ipl.ElementAt(0).fourwicket;
            ballstaken.FontSize = 24;
            ballstaken.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
            ballstaken.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ballstaken_content = new TextBlock();
            ballstaken_content.Text = "FOUR WICKET";
            ballstaken_content.FontSize = 24;
            ballstaken_content.Foreground = new SolidColorBrush(Colors.Blue);
            ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_balls = new StackPanel();
            stk_balls.Height = 50;
            stk_balls.Children.Add(ballstaken_content);
            stk_balls.Children.Add(ballstaken);





            TextBlock sixes = new TextBlock();
            sixes.Text = bowling_ipl.ElementAt(0).fivewicket;
            sixes.FontSize = 24;
            sixes.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes.HorizontalAlignment = HorizontalAlignment.Right;
            sixes.Margin = new Thickness(280, -30, 0, 0);
            TextBlock sixes_content = new TextBlock();
            sixes_content.Text = "FIVE WICKET";
            sixes_content.FontSize = 24;
            sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
            sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_six = new StackPanel();
            stk_six.Height = 50;
            stk_six.Children.Add(sixes_content);
            stk_six.Children.Add(sixes);


            TextBlock fours = new TextBlock();
            fours.Text = bowling_ipl.ElementAt(0).tenwicket;
            fours.Foreground = new SolidColorBrush(Colors.Brown);
            fours.HorizontalAlignment = HorizontalAlignment.Right;
            fours.FontSize = 24;
            fours.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fours_content = new TextBlock();
            fours_content.Text = "TEN WICKET";
            fours_content.FontSize = 24;
            fours_content.Foreground = new SolidColorBrush(Colors.Brown);
            fours_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_four = new StackPanel();
            stk_four.Height = 50;
            stk_four.Children.Add(fours_content);
            stk_four.Children.Add(fours);


            TextBlock ducks = new TextBlock();
            ducks.Text = bowling_ipl.ElementAt(0).bestbowlinginInnings;
            ducks.FontSize = 24;
            ducks.Foreground = new SolidColorBrush(Colors.Black);
            ducks.HorizontalAlignment = HorizontalAlignment.Right;
            ducks.Margin = new Thickness(280, -30, 0, 0);
            TextBlock ducks_content = new TextBlock();
            ducks_content.Text = "BEST BOWLING INNINGS";
            ducks_content.FontSize = 24;
            ducks_content.Foreground = new SolidColorBrush(Colors.Black);
            ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_ducks = new StackPanel();
            stk_ducks.Height = 50;
            stk_ducks.Children.Add(ducks_content);
            stk_ducks.Children.Add(ducks);




            TextBlock fifties = new TextBlock();
            fifties.Text = bowling_ipl.ElementAt(0).bestbowlinginMatch;
            fifties.FontSize = 24;
            fifties.HorizontalAlignment = HorizontalAlignment.Right;
            fifties.Foreground = new SolidColorBrush(Colors.Green);
            fifties.Margin = new Thickness(280, -30, 0, 0);
            TextBlock fifties_content = new TextBlock();
            fifties_content.Text = "BEST BOWLING MATCH";
            fifties_content.FontSize = 24;
            fifties_content.Foreground = new SolidColorBrush(Colors.Green);
            fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_fifty = new StackPanel();
            stk_fifty.Height = 50;
            stk_fifty.Children.Add(fifties_content);
            stk_fifty.Children.Add(fifties);


            TextBlock catches = new TextBlock();
            catches.Text = bowling_ipl.ElementAt(0).economyrate;
            catches.FontSize = 24;
            catches.Foreground = new SolidColorBrush(Colors.Purple);
            catches.HorizontalAlignment = HorizontalAlignment.Right;
            catches.Margin = new Thickness(280, -30, 0, 0);
            TextBlock catches_content = new TextBlock();
            catches_content.Text = "ECONOMY RATE";
            catches_content.FontSize = 24;
            catches_content.Foreground = new SolidColorBrush(Colors.Purple);
            catches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_catch = new StackPanel();
            stk_catch.Height = 50;
            stk_catch.Children.Add(catches_content);
            stk_catch.Children.Add(catches);

   /*

            TextBlock stumings = new TextBlock();
            stumings.Text = bowling_ipl.ElementAt(0).strikerate;
            stumings.Foreground = new SolidColorBrush(Colors.Red);
            stumings.HorizontalAlignment = HorizontalAlignment.Right;
            stumings.Margin = new Thickness(280, -30, 0, 0);
            stumings.FontSize = 24;
            TextBlock stumings_content = new TextBlock();
            stumings_content.Text = "STRIKE RATE";
            stumings_content.FontSize = 24;
            stumings_content.Foreground = new SolidColorBrush(Colors.Red);
            stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_stumin = new StackPanel();
            stk_stumin.Height = 50;
            stk_stumin.Children.Add(stumings_content);
            stk_stumin.Children.Add(stumings);
         
            TextBlock hundreds = new TextBlock();
            hundreds.Text = bowling_ipl.ElementAt(0).average;
            hundreds.FontSize = 24;
            hundreds.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds.HorizontalAlignment = HorizontalAlignment.Right;
            hundreds.Margin = new Thickness(280, -30, 0, 0);
            TextBlock hundreds_cotent = new TextBlock();
            hundreds_cotent.Text = "AVERAGE";
            hundreds_cotent.FontSize = 24;
            hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
            hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_hundr = new StackPanel();
            stk_hundr.Height = 50;
            stk_hundr.Children.Add(hundreds_cotent);
            stk_hundr.Children.Add(hundreds);
            */
            /*

            TextBlock average = new TextBlock();
            average.Text = batting_odi.ElementAt(0).average;
            average.FontSize = 24;
            average.Foreground = new SolidColorBrush(Colors.Gray);
            average.HorizontalAlignment = HorizontalAlignment.Right;
            average.Margin = new Thickness(280, -30, 0, 0);
            TextBlock average_content = new TextBlock();
            average_content.Text = "AVERAGE";
            average_content.FontSize = 24;
            average_content.Foreground = new SolidColorBrush(Colors.Gray);
            average_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_aver = new StackPanel();
            stk_aver.Height = 50;
            stk_aver.Children.Add(average_content);
            stk_aver.Children.Add(average);


            */


            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            items.Items.Add(stk_balls);
            items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            items.Items.Add(stk_four);
            items.Items.Add(stk_fifty);
            items.Items.Add(stk_ducks);
            items.Items.Add(stk_catch);
          //  items.Items.Add(stk_stumin);
          //  items.Items.Add(stk_hundr);
            // items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);


            /*
            stk.Children.Add(matches);
            stk.Children.Add(matchtype);
            stk.Children.Add(innings);
            stk.Children.Add(notout);
            stk.Children.Add(runsscored);
            stk.Children.Add(ballstaken);
            stk.Children.Add(sixes);
            stk.Children.Add(fours);
            stk.Children.Add(ducks);
            stk.Children.Add(fifties);
            stk.Children.Add(catches);
            stk.Children.Add(stumings);
            stk.Children.Add(hundreds);
            stk.Children.Add(average); */
            brw.Child = stk;
            bowling.Child = brw;
            bowling.IsOpen = true;
            

        }

        Popup career = new Popup();
        Border brc = new Border();
        private void button4_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                button2.Background = new SolidColorBrush(Colors.Black);
                button3.Background = new SolidColorBrush(Colors.Black);
                button4.Background = new SolidColorBrush(Colors.Brown);
                button1.Background = new SolidColorBrush(Colors.Black);
                batting.IsOpen = false;
                personalinfo.IsOpen = false;
                bowling.IsOpen = false;


                batting.IsOpen = false;
                personalinfo.IsOpen = false;

                ListBox items = new ListBox();
                // Border br = new Border();
                brc.BorderThickness = new Thickness(3.0);
                brc.BorderBrush = new SolidColorBrush(Colors.Green);
                brc.Margin = new Thickness(20, 200, 0, 0);
                StackPanel stk = new StackPanel();
                stk.Height = 580;
                stk.Width = 440;
                // stk.Background = new SolidColorBrush(Colors.LightGray);
                Button btn_cod = new Button();
                btn_cod.Content = "ODI";
                btn_cod.Name = "btn_odi";
                btn_cod.Height = 80;
                btn_cod.Width = 100;
                btn_cod.Margin = new Thickness(0, 0, 0, 0);
                btn_cod.BorderThickness = new Thickness(0);
                btn_cod.Background = new SolidColorBrush(Colors.DarkGray);
                btn_cod.Click += new RoutedEventHandler(btn_cod_Click);
                btn_cod.HorizontalAlignment = HorizontalAlignment.Left;
                Button btn_ctest = new Button();
                btn_ctest.Content = "TEST";
                btn_ctest.Name = "btn_test";
                btn_ctest.Height = 80;
                btn_ctest.Width = 100;
                btn_ctest.BorderThickness = new Thickness(0);
                btn_ctest.Background = new SolidColorBrush(Colors.Brown);
                btn_ctest.HorizontalAlignment = HorizontalAlignment.Center;
                btn_ctest.Margin = new Thickness(-175, -80, 0, 0);
                btn_ctest.Click += new RoutedEventHandler(btn_ctest_Click);

                Button btn_cipl = new Button();
                btn_cipl.Content = "IPL";
                btn_cipl.Name = "btn_ipl";
                btn_cipl.Height = 80;
                btn_cipl.Width = 100;
                btn_cipl.HorizontalAlignment = HorizontalAlignment.Center;
                btn_cipl.BorderThickness = new Thickness(0);
                btn_cipl.Background = new SolidColorBrush(Colors.Brown);
                btn_cipl.Margin = new Thickness(15, -80, 0, 0);
                btn_cipl.Click += new RoutedEventHandler(btn_cipl_Click);
                Button btn_ct20 = new Button();
                btn_ct20.Content = "T20";
                btn_ct20.Name = "btn_t20";
                btn_ct20.Height = 80;
                btn_ct20.Width = 100;
                btn_ct20.HorizontalAlignment = HorizontalAlignment.Center;
                btn_ct20.BorderThickness = new Thickness(0);
                btn_ct20.Background = new SolidColorBrush(Colors.Brown);
                btn_ct20.Margin = new Thickness(200, -80, 0, 0);
                btn_ct20.Click += new RoutedEventHandler(btn_ct20_Click);
                Button btn_bcl = new Button();
                btn_bcl.Content = "CL";
                btn_bcl.Name = "btn_cl";
                btn_bcl.Height = 80;
                btn_bcl.Width = 90;
                btn_bcl.BorderThickness = new Thickness(0);
                btn_bcl.Background = new SolidColorBrush(Colors.Brown);
                btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
                btn_bcl.Margin = new Thickness(10, -80, 0, 0);
                btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
                stk.Children.Add(btn_cod);
                stk.Children.Add(btn_ctest);
                stk.Children.Add(btn_cipl);
                stk.Children.Add(btn_ct20);
                // stk.Children.Add(btn_bcl);
                items.Height = 480;
                items.Width = 400;


                TextBlock matches = new TextBlock();
                TextBlock matches_content = new TextBlock();
                StackPanel stk_match = new StackPanel();
                try
                {
                    matches.Text = career_odi.ElementAt(0).debuton;
                    matches.FontSize = 24;
                    matches.TextWrapping = TextWrapping.Wrap;
                    matches.HorizontalAlignment = HorizontalAlignment.Left;
                    matches.Foreground = new SolidColorBrush(Colors.Red);
                    matches.Margin = new Thickness(255, -30, 0, 0);


                    matches_content.Text = "DEBUTON";
                    matches_content.FontSize = 24;
                    matches_content.Foreground = new SolidColorBrush(Colors.Red);
                    matches_content.HorizontalAlignment = HorizontalAlignment.Left;

                    stk_match.Height = 50;
                    stk_match.Children.Add(matches_content);
                    stk_match.Children.Add(matches);

                }
                catch (Exception eerr)
                {

                }
                TextBlock innings = new TextBlock();
                innings.Text = career_odi.ElementAt(0).debutagainst;
                innings.FontSize = 24;
                innings.TextWrapping = TextWrapping.Wrap;
                innings.HorizontalAlignment = HorizontalAlignment.Right;
                innings.Foreground = new SolidColorBrush(Colors.Blue);
                innings.Margin = new Thickness(255, -30, 0, 0);
                TextBlock innings_content = new TextBlock();
                innings_content.Text = "DEBUTAGAINST";
                innings_content.FontSize = 24;
                innings_content.Foreground = new SolidColorBrush(Colors.Blue);
                innings_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_inn = new StackPanel();
                stk_inn.Height = 50;
                stk_inn.Children.Add(innings_content);
                stk_inn.Children.Add(innings);

                TextBlock matchtype = new TextBlock();
                matchtype.Text = career_odi.ElementAt(0).debutat;
                matchtype.FontSize = 24;
                matchtype.HorizontalAlignment = HorizontalAlignment.Right;
                matchtype.Foreground = new SolidColorBrush(Colors.Blue);
                matchtype.Margin = new Thickness(255, -30, 0, 0);
                matchtype.TextWrapping = TextWrapping.Wrap;
                TextBlock matchtype_content = new TextBlock();
                matchtype_content.Text = "DEBUTAT";
                matchtype_content.FontSize = 24;
                matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
                matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
                StackPanel stk_matchtype = new StackPanel();
                stk_matchtype.Height = 50;
                stk_matchtype.Children.Add(matchtype_content);
                stk_matchtype.Children.Add(matchtype);

                TextBlock notout = new TextBlock();
                notout.Text = career_odi.ElementAt(0).lastodiplayedon;
                notout.FontSize = 24;
                notout.HorizontalAlignment = HorizontalAlignment.Right;
                notout.Foreground = new SolidColorBrush(Colors.Magenta);

                notout.Margin = new Thickness(255, -30, 0, 0);
                TextBlock notout_content = new TextBlock();
                notout_content.Text = "LAST ODIPLAYED ON";
                notout_content.FontSize = 24;
                notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
                notout_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_not = new StackPanel();
                stk_not.Height = 50;
                stk_not.Children.Add(notout_content);
                stk_not.Children.Add(notout);



                TextBlock runsscored = new TextBlock();
                runsscored.Text = career_odi.ElementAt(0).lastodiplayedagainst;
                runsscored.FontSize = 24;
                runsscored.HorizontalAlignment = HorizontalAlignment.Right;
                runsscored.Foreground = new SolidColorBrush(Colors.Black);
                runsscored.Margin = new Thickness(280, -30, 0, 0);

                TextBlock runsscored_content = new TextBlock();
                runsscored_content.Text = "LAST PLAYED AGAINST";
                runsscored_content.FontSize = 24;
                runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
                runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
                StackPanel stk_runs = new StackPanel();
                stk_runs.Height = 50;

                stk_runs.Children.Add(runsscored_content);
                stk_runs.Children.Add(runsscored);


                TextBlock highestscore = new TextBlock();
                highestscore.Text = career_odi.ElementAt(0).lastodiplayeddat;
                highestscore.FontSize = 24;
                highestscore.Margin = new Thickness(280, -30, 0, 0);
                highestscore.HorizontalAlignment = HorizontalAlignment.Right;
                highestscore.Foreground = new SolidColorBrush(Colors.Purple);
                highestscore.TextWrapping = TextWrapping.Wrap;
                TextBlock highestscore_content = new TextBlock();
                highestscore_content.Text = "LAST PLAYED AT";
                highestscore_content.FontSize = 24;
                highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
                highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
                StackPanel stk_high = new StackPanel();
                stk_high.Height = 50;

                stk_high.Children.Add(highestscore_content);
                stk_high.Children.Add(highestscore);


                /*
                TextBlock ballstaken = new TextBlock();
                ballstaken.Text = bowling_odi.ElementAt(0).fourwicket;
                ballstaken.FontSize = 24;
                ballstaken.Foreground = new SolidColorBrush(Colors.DarkGray);
                ballstaken.HorizontalAlignment = HorizontalAlignment.Right;
                ballstaken.Margin = new Thickness(280, -30, 0, 0);
                TextBlock ballstaken_content = new TextBlock();
                ballstaken_content.Text = "FOUR WICKET";
                ballstaken_content.FontSize = 24;
                ballstaken_content.Foreground = new SolidColorBrush(Colors.DarkGray);
                ballstaken_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_balls = new StackPanel();
                stk_balls.Height = 50;
                stk_balls.Children.Add(ballstaken_content);
                stk_balls.Children.Add(ballstaken);





                TextBlock sixes = new TextBlock();
                sixes.Text = bowling_odi.ElementAt(0).fivewicket;
                sixes.FontSize = 24;
                sixes.Foreground = new SolidColorBrush(Colors.Cyan);
                sixes.HorizontalAlignment = HorizontalAlignment.Right;
                sixes.Margin = new Thickness(280, -30, 0, 0);
                TextBlock sixes_content = new TextBlock();
                sixes_content.Text = "FIVE WICKET";
                sixes_content.FontSize = 24;
                sixes_content.Foreground = new SolidColorBrush(Colors.Cyan);
                sixes_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_six = new StackPanel();
                stk_six.Height = 50;
                stk_six.Children.Add(sixes_content);
                stk_six.Children.Add(sixes);


                TextBlock fours = new TextBlock();
                fours.Text = bowling_odi.ElementAt(0).tenwicket;
                fours.Foreground = new SolidColorBrush(Colors.Brown);
                fours.HorizontalAlignment = HorizontalAlignment.Right;
                fours.FontSize = 24;
                fours.Margin = new Thickness(280, -30, 0, 0);
                TextBlock fours_content = new TextBlock();
                fours_content.Text = "TEN WICKET";
                fours_content.FontSize = 24;
                fours_content.Foreground = new SolidColorBrush(Colors.Brown);
                fours_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_four = new StackPanel();
                stk_four.Height = 50;
                stk_four.Children.Add(fours_content);
                stk_four.Children.Add(fours);


                TextBlock ducks = new TextBlock();
                ducks.Text = bowling_odi.ElementAt(0).bestbowlinginInnings;
                ducks.FontSize = 24;
                ducks.Foreground = new SolidColorBrush(Colors.Yellow);
                ducks.HorizontalAlignment = HorizontalAlignment.Right;
                ducks.Margin = new Thickness(280, -30, 0, 0);
                TextBlock ducks_content = new TextBlock();
                ducks_content.Text = "BEST BOWLING INNINGS";
                ducks_content.FontSize = 24;
                ducks_content.Foreground = new SolidColorBrush(Colors.Yellow);
                ducks_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_ducks = new StackPanel();
                stk_ducks.Height = 50;
                stk_ducks.Children.Add(ducks_content);
                stk_ducks.Children.Add(ducks);




                TextBlock fifties = new TextBlock();
                fifties.Text = bowling_odi.ElementAt(0).bestbowlinginMatch;
                fifties.FontSize = 24;
                fifties.HorizontalAlignment = HorizontalAlignment.Right;
                fifties.Foreground = new SolidColorBrush(Colors.Green);
                fifties.Margin = new Thickness(280, -30, 0, 0);
                TextBlock fifties_content = new TextBlock();
                fifties_content.Text = "BEST BOWLING MATCH";
                fifties_content.FontSize = 24;
                fifties_content.Foreground = new SolidColorBrush(Colors.Green);
                fifties_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_fifty = new StackPanel();
                stk_fifty.Height = 50;
                stk_fifty.Children.Add(fifties_content);
                stk_fifty.Children.Add(fifties);


                TextBlock catches = new TextBlock();
                catches.Text = bowling_odi.ElementAt(0).economyrate;
                catches.FontSize = 24;
                catches.Foreground = new SolidColorBrush(Colors.Purple);
                catches.HorizontalAlignment = HorizontalAlignment.Right;
                catches.Margin = new Thickness(280, -30, 0, 0);
                TextBlock catches_content = new TextBlock();
                catches_content.Text = "ECONOMY RATE";
                catches_content.FontSize = 24;
                catches_content.Foreground = new SolidColorBrush(Colors.Purple);
                catches_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_catch = new StackPanel();
                stk_catch.Height = 50;
                stk_catch.Children.Add(catches_content);
                stk_catch.Children.Add(catches);



                TextBlock stumings = new TextBlock();
                stumings.Text = bowling_odi.ElementAt(0).strikerate;
                stumings.Foreground = new SolidColorBrush(Colors.Red);
                stumings.HorizontalAlignment = HorizontalAlignment.Right;
                stumings.Margin = new Thickness(280, -30, 0, 0);
                stumings.FontSize = 24;
                TextBlock stumings_content = new TextBlock();
                stumings_content.Text = "STRIKE RATE";
                stumings_content.FontSize = 24;
                stumings_content.Foreground = new SolidColorBrush(Colors.Red);
                stumings_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_stumin = new StackPanel();
                stk_stumin.Height = 50;
                stk_stumin.Children.Add(stumings_content);
                stk_stumin.Children.Add(stumings);

                TextBlock hundreds = new TextBlock();
                hundreds.Text = bowling_odi.ElementAt(0).average;
                hundreds.FontSize = 24;
                hundreds.Foreground = new SolidColorBrush(Colors.Blue);
                hundreds.HorizontalAlignment = HorizontalAlignment.Right;
                hundreds.Margin = new Thickness(280, -30, 0, 0);
                TextBlock hundreds_cotent = new TextBlock();
                hundreds_cotent.Text = "AVERAGE";
                hundreds_cotent.FontSize = 24;
                hundreds_cotent.Foreground = new SolidColorBrush(Colors.Blue);
                hundreds_cotent.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_hundr = new StackPanel();
                stk_hundr.Height = 50;
                stk_hundr.Children.Add(hundreds_cotent);
                stk_hundr.Children.Add(hundreds);
                */
                /*

                TextBlock average = new TextBlock();
                average.Text = batting_odi.ElementAt(0).average;
                average.FontSize = 24;
                average.Foreground = new SolidColorBrush(Colors.Gray);
                average.HorizontalAlignment = HorizontalAlignment.Right;
                average.Margin = new Thickness(280, -30, 0, 0);
                TextBlock average_content = new TextBlock();
                average_content.Text = "AVERAGE";
                average_content.FontSize = 24;
                average_content.Foreground = new SolidColorBrush(Colors.Gray);
                average_content.HorizontalAlignment = HorizontalAlignment.Left;
                StackPanel stk_aver = new StackPanel();
                stk_aver.Height = 50;
                stk_aver.Children.Add(average_content);
                stk_aver.Children.Add(average);


                */


                items.HorizontalAlignment = HorizontalAlignment.Center;
                items.Items.Add(stk_matchtype);
                items.Items.Add(stk_match);
                //    items.Items.Add(matches);
                items.Items.Add(stk_inn);
                //  items.Items.Add(matchtype);
                //   items.Items.Add(innings);

                items.Items.Add(stk_not);
                items.Items.Add(stk_runs);
                items.Items.Add(stk_high);
                //  items.Items.Add(stk_balls);
                //items.Items.Add(stk_six);

                //  items.Items.Add(runsscored);
                //  items.Items.Add(ballstaken);
                // items.Items.Add(sixes);
                //items.Items.Add(stk_four);
                // items.Items.Add(stk_fifty);
                // items.Items.Add(stk_ducks);
                // items.Items.Add(stk_catch);
                // items.Items.Add(stk_stumin);
                //   items.Items.Add(stk_hundr);
                // items.Items.Add(stk_aver);

                // items.Items.Add(fours);
                // items.Items.Add(ducks);
                // items.Items.Add(fifties);
                // items.Items.Add(catches);
                //  items.Items.Add(stumings);
                //  items.Items.Add(hundreds);
                //  items.Items.Add(average);
                stk.Children.Add(items);

                brc.Child = stk;
                career.Child = brc;
                career.IsOpen = true;


            }
            catch (Exception ase)
            {
                MessageBox.Show("Please wait it is loading and try again");
            }




        }
        private void btn_cod_Click(object sender, RoutedEventArgs e)
        {
            
            batting.IsOpen = false;
            personalinfo.IsOpen = false;
            bowling.IsOpen = false;


            batting.IsOpen = false;
            personalinfo.IsOpen = false;

            ListBox items = new ListBox();
            // Border br = new Border();
            brc.BorderThickness = new Thickness(3.0);
            brc.BorderBrush = new SolidColorBrush(Colors.Green);
            brc.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_cod = new Button();
            btn_cod.Content = "ODI";
            btn_cod.Name = "btn_odi";
            btn_cod.Height = 80;
            btn_cod.Width = 100;
            btn_cod.Margin = new Thickness(0, 0, 0, 0);
            btn_cod.BorderThickness = new Thickness(0);
            btn_cod.Background = new SolidColorBrush(Colors.DarkGray);
            btn_cod.Click += new RoutedEventHandler(btn_cod_Click);
            btn_cod.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_ctest = new Button();
            btn_ctest.Content = "TEST";
            btn_ctest.Name = "btn_test";
            btn_ctest.Height = 80;
            btn_ctest.Width = 100;
            btn_ctest.BorderThickness = new Thickness(0);
            btn_ctest.Background = new SolidColorBrush(Colors.Brown);
            btn_ctest.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ctest.Margin = new Thickness(-175, -80, 0, 0);
            btn_ctest.Click += new RoutedEventHandler(btn_ctest_Click);

            Button btn_cipl = new Button();
            btn_cipl.Content = "IPL";
            btn_cipl.Name = "btn_ipl";
            btn_cipl.Height = 80;
            btn_cipl.Width = 100;
            btn_cipl.BorderThickness = new Thickness(0);
            btn_cipl.Background = new SolidColorBrush(Colors.Brown);
            btn_cipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_cipl.Margin = new Thickness(15, -80, 0, 0);
            btn_cipl.Click += new RoutedEventHandler(btn_cipl_Click);
            Button btn_ct20 = new Button();
            btn_ct20.Content = "T20";
            btn_ct20.Name = "btn_t20";
            btn_ct20.Height = 80;
            btn_ct20.Width = 100;
            btn_ct20.BorderThickness = new Thickness(0);
            btn_ct20.Background = new SolidColorBrush(Colors.Brown);
            btn_ct20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ct20.Margin = new Thickness(200, -80, 0, 0);
            btn_ct20.Click += new RoutedEventHandler(btn_ct20_Click);
            Button btn_bcl = new Button();
            btn_bcl.Content = "CL";
            btn_bcl.Name = "btn_cl";
            btn_bcl.Height = 80;
            btn_bcl.Width = 90;
            btn_bcl.BorderThickness = new Thickness(0);
            btn_bcl.Background = new SolidColorBrush(Colors.Brown);
            btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_bcl.Margin = new Thickness(10, -80, 0, 0);
            btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
            stk.Children.Add(btn_cod);
            stk.Children.Add(btn_ctest);
            stk.Children.Add(btn_cipl);
            stk.Children.Add(btn_ct20);
            // stk.Children.Add(btn_bcl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = career_odi.ElementAt(0).debuton;
            matches.FontSize = 24;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(255, -30, 0, 0);
            matches.TextWrapping = TextWrapping.Wrap;
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "DEBUTON";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = career_odi.ElementAt(0).debutagainst;
            innings.FontSize = 24;
            innings.TextWrapping = TextWrapping.Wrap;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(255, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "DEBUTAGAINST";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = career_odi.ElementAt(0).debutat;
            matchtype.FontSize = 24;
            matchtype.TextWrapping = TextWrapping.Wrap;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Green);
            matchtype.Margin = new Thickness(255, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "DEBUTAT";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Green);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = career_odi.ElementAt(0).lastodiplayedon;
            notout.FontSize = 24;
            notout.TextWrapping = TextWrapping.Wrap;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(255, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "LAST ODIPLAYED ON";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = career_odi.ElementAt(0).lastodiplayedagainst;
            runsscored.FontSize = 24;
            runsscored.TextWrapping = TextWrapping.Wrap;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(262, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "LAST PLAYED AGAINST";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = career_odi.ElementAt(0).lastodiplayeddat;
            highestscore.FontSize = 24;
            highestscore.TextWrapping = TextWrapping.Wrap;
            highestscore.Margin = new Thickness(262, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "LAST PLAYED AT";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);
            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            //  items.Items.Add(stk_balls);
            //items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            //items.Items.Add(stk_four);
            // items.Items.Add(stk_fifty);
            // items.Items.Add(stk_ducks);
            // items.Items.Add(stk_catch);
            // items.Items.Add(stk_stumin);
            //   items.Items.Add(stk_hundr);
            // items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);

            brc.Child = stk;
            career.Child = brc;
            career.IsOpen = true;




 
        }
        private void btn_cipl_Click(object sender, RoutedEventArgs e)
        {
            batting.IsOpen = false;
            personalinfo.IsOpen = false;
            bowling.IsOpen = false;


            batting.IsOpen = false;
            personalinfo.IsOpen = false;

            ListBox items = new ListBox();
            // Border br = new Border();
            brc.BorderThickness = new Thickness(3.0);
            brc.BorderBrush = new SolidColorBrush(Colors.Green);
            brc.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_cod = new Button();
            btn_cod.Content = "ODI";
            btn_cod.Name = "btn_odi";
            btn_cod.Height = 80;
            btn_cod.Width = 100;
            btn_cod.BorderThickness = new Thickness(0);
            btn_cod.Background = new SolidColorBrush(Colors.Brown);
            btn_cod.Margin = new Thickness(0, 0, 0, 0);
            btn_cod.Click += new RoutedEventHandler(btn_cod_Click);
            btn_cod.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_ctest = new Button();
            btn_ctest.Content = "TEST";
            btn_ctest.Name = "btn_test";
            btn_ctest.Height = 80;
            btn_ctest.Width = 100;
            btn_ctest.BorderThickness = new Thickness(0);
            btn_ctest.Background = new SolidColorBrush(Colors.Brown);
            btn_ctest.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ctest.Margin = new Thickness(-175, -80, 0, 0);
            btn_ctest.Click += new RoutedEventHandler(btn_ctest_Click);

            Button btn_cipl = new Button();
            btn_cipl.Content = "IPL";
            btn_cipl.Name = "btn_ipl";
            btn_cipl.Height = 80;
            btn_cipl.Width = 100;
            btn_cipl.BorderThickness = new Thickness(0);
            btn_cipl.Background = new SolidColorBrush(Colors.DarkGray);
            btn_cipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_cipl.Margin = new Thickness(15, -80, 0, 0);
            btn_cipl.Click += new RoutedEventHandler(btn_cipl_Click);
            Button btn_ct20 = new Button();
            btn_ct20.Content = "T20";
            btn_ct20.Name = "btn_t20";
            btn_ct20.Height = 80;
            btn_ct20.Width = 100;
            btn_ct20.BorderThickness = new Thickness(0);
            btn_ct20.Background = new SolidColorBrush(Colors.Brown);
            btn_ct20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ct20.Margin = new Thickness(200, -80, 0, 0);
            btn_ct20.Click += new RoutedEventHandler(btn_ct20_Click);
            Button btn_bcl = new Button();
            btn_bcl.Content = "CL";
            btn_bcl.Name = "btn_cl";
            btn_bcl.Height = 80;
            btn_bcl.Width = 90;
            btn_bcl.BorderThickness = new Thickness(0);
            btn_bcl.Background = new SolidColorBrush(Colors.Brown);
            btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_bcl.Margin = new Thickness(10, -80, 0, 0);
            btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
            stk.Children.Add(btn_cod);
            stk.Children.Add(btn_ctest);
            stk.Children.Add(btn_cipl);
            stk.Children.Add(btn_ct20);
            // stk.Children.Add(btn_bcl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = career_ipl.ElementAt(0).debuton;
            matches.FontSize = 24;
            matches.TextWrapping = TextWrapping.Wrap;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(255, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "DEBUTON";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = career_ipl.ElementAt(0).debutagainst;
            innings.FontSize = 24;
            innings.TextWrapping = TextWrapping.Wrap;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(255, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "DEBUTAGAINST";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = career_ipl.ElementAt(0).debutat;
            matchtype.FontSize = 24;
            matchtype.TextWrapping = TextWrapping.Wrap;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(255, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "DEBUTAT";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = career_ipl.ElementAt(0).lastiplplayedon;
            notout.FontSize = 24;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);
            notout.TextWrapping = TextWrapping.Wrap;
            notout.Margin = new Thickness(255, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "LAST ODIPLAYED ON";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = career_ipl.ElementAt(0).lastiplplayedagainst;
            runsscored.FontSize = 24;
            runsscored.TextWrapping = TextWrapping.Wrap;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(262, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "LAST PLAYED AGAINST";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = career_ipl.ElementAt(0).lastiplplayeddat;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(262, -30, 0, 0);
            highestscore.TextWrapping = TextWrapping.Wrap;
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "LAST PLAYED AT";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);
            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            //  items.Items.Add(stk_balls);
            //items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            //items.Items.Add(stk_four);
            // items.Items.Add(stk_fifty);
            // items.Items.Add(stk_ducks);
            // items.Items.Add(stk_catch);
            // items.Items.Add(stk_stumin);
            //   items.Items.Add(stk_hundr);
            // items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);

            brc.Child = stk;
            career.Child = brc;
            career.IsOpen = true;

 
        }
        private void btn_ct20_Click(object sender, RoutedEventArgs e)
        {
            batting.IsOpen = false;
            personalinfo.IsOpen = false;
            bowling.IsOpen = false;


            batting.IsOpen = false;
            personalinfo.IsOpen = false;

            ListBox items = new ListBox();
            // Border br = new Border();
            brc.BorderThickness = new Thickness(3.0);
            brc.BorderBrush = new SolidColorBrush(Colors.Green);
            brc.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_cod = new Button();
            btn_cod.Content = "ODI";
            btn_cod.Name = "btn_odi";
            btn_cod.Height = 80;
            btn_cod.Width = 100;
            btn_cod.BorderThickness = new Thickness(0);
            btn_cod.Background = new SolidColorBrush(Colors.Brown);
            btn_cod.Margin = new Thickness(0, 0, 0, 0);
            btn_cod.Click += new RoutedEventHandler(btn_cod_Click);
            btn_cod.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_ctest = new Button();
            btn_ctest.Content = "TEST";
            btn_ctest.Name = "btn_test";
            btn_ctest.Height = 80;
            btn_ctest.Width = 100;
            btn_ctest.BorderThickness = new Thickness(0);
            btn_ctest.Background = new SolidColorBrush(Colors.Brown);
            btn_ctest.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ctest.Margin = new Thickness(-175, -80, 0, 0);
            btn_ctest.Click += new RoutedEventHandler(btn_ctest_Click);

            Button btn_cipl = new Button();
            btn_cipl.Content = "IPL";
            btn_cipl.Name = "btn_ipl";
            btn_cipl.Height = 80;
            btn_cipl.Width = 100;
            btn_cipl.BorderThickness = new Thickness(0);
            btn_cipl.Background = new SolidColorBrush(Colors.Brown);
            btn_cipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_cipl.Margin = new Thickness(15, -80, 0, 0);
            btn_cipl.Click += new RoutedEventHandler(btn_cipl_Click);
            Button btn_ct20 = new Button();
            btn_ct20.Content = "T20";
            btn_ct20.Name = "btn_t20";
            btn_ct20.Height = 80;
            btn_ct20.Width = 100;
            btn_ct20.BorderThickness = new Thickness(0);
            btn_ct20.Background = new SolidColorBrush(Colors.DarkGray);
            btn_ct20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ct20.Margin = new Thickness(200, -80, 0, 0);
            btn_ct20.Click += new RoutedEventHandler(btn_ct20_Click);
            Button btn_bcl = new Button();
            btn_bcl.Content = "CL";
            btn_bcl.Name = "btn_cl";
            btn_bcl.Height = 80;
            btn_bcl.Width = 90;
            btn_bcl.BorderThickness = new Thickness(0);
            btn_bcl.Background = new SolidColorBrush(Colors.Brown);
            btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_bcl.Margin = new Thickness(10, -80, 0, 0);
            btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
            stk.Children.Add(btn_cod);
            stk.Children.Add(btn_ctest);
            stk.Children.Add(btn_cipl);
            stk.Children.Add(btn_ct20);
            // stk.Children.Add(btn_bcl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = career_t20.ElementAt(0).debuton;
            matches.FontSize = 24;
            matches.TextWrapping = TextWrapping.Wrap;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(255, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "DEBUTON";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = career_t20.ElementAt(0).debutagainst;
            innings.TextWrapping = TextWrapping.Wrap;
            innings.FontSize = 24;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(255, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "DEBUTAGAINST";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = career_t20.ElementAt(0).debutat;
            matchtype.FontSize = 24;
            matchtype.TextWrapping = TextWrapping.Wrap;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(255, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "DEBUTAT";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = career_t20.ElementAt(0).lastt20playedon;
            notout.FontSize = 24;
            notout.TextWrapping = TextWrapping.Wrap;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(255, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "LAST ODIPLAYED ON";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = career_t20.ElementAt(0).lastt20playedagainst;
            runsscored.FontSize = 24;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(262, -30, 0, 0);
            runsscored.TextWrapping = TextWrapping.Wrap;
            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "LAST PLAYED AGAINST";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


        /*    TextBlock highestscore = new TextBlock();
            highestscore.Text = career_t20.ElementAt(0).lastt20playeddat;
            highestscore.FontSize = 24;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "LAST PLAYED AT";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore); */
            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
           // items.Items.Add(stk_high);
            //  items.Items.Add(stk_balls);
            //items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            //items.Items.Add(stk_four);
            // items.Items.Add(stk_fifty);
            // items.Items.Add(stk_ducks);
            // items.Items.Add(stk_catch);
            // items.Items.Add(stk_stumin);
            //   items.Items.Add(stk_hundr);
            // items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);

            brc.Child = stk;
            career.Child = brc;
            career.IsOpen = true;
        }
        private void btn_ctest_Click(object sender, RoutedEventArgs e)
        {
            batting.IsOpen = false;
            personalinfo.IsOpen = false;
            bowling.IsOpen = false;


            batting.IsOpen = false;
            personalinfo.IsOpen = false;

            ListBox items = new ListBox();
            // Border br = new Border();
            brc.BorderThickness = new Thickness(3.0);
            brc.BorderBrush = new SolidColorBrush(Colors.Green);
            brc.Margin = new Thickness(20, 200, 0, 0);
            StackPanel stk = new StackPanel();
            stk.Height = 580;
            stk.Width = 440;
            // stk.Background = new SolidColorBrush(Colors.LightGray);
            Button btn_cod = new Button();
            btn_cod.Content = "ODI";
            btn_cod.Name = "btn_odi";
            btn_cod.Height = 80;
            btn_cod.Width = 100;
            btn_cod.Margin = new Thickness(0, 0, 0, 0);
            btn_cod.BorderThickness = new Thickness(0);
            btn_cod.Background = new SolidColorBrush(Colors.Brown);
            btn_cod.Click += new RoutedEventHandler(btn_cod_Click);
            btn_cod.HorizontalAlignment = HorizontalAlignment.Left;
            Button btn_ctest = new Button();
            btn_ctest.Content = "TEST";
            btn_ctest.Name = "btn_test";
            btn_ctest.Height = 80;
            btn_ctest.Width = 100;
            btn_ctest.BorderThickness = new Thickness(0);
            btn_ctest.Background = new SolidColorBrush(Colors.DarkGray);
            btn_ctest.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ctest.Margin = new Thickness(-175, -80, 0, 0);
            btn_ctest.Click += new RoutedEventHandler(btn_ctest_Click);

            Button btn_cipl = new Button();
            btn_cipl.Content = "IPL";
            btn_cipl.Name = "btn_ipl";
            btn_cipl.Height = 80;
            btn_cipl.Width = 100;
            btn_cipl.BorderThickness = new Thickness(0);
            btn_cipl.Background = new SolidColorBrush(Colors.Brown);
            btn_cipl.HorizontalAlignment = HorizontalAlignment.Center;
            btn_cipl.Margin = new Thickness(15, -80, 0, 0);
            btn_cipl.Click += new RoutedEventHandler(btn_cipl_Click);
            Button btn_ct20 = new Button();
            btn_ct20.Content = "T20";
            btn_ct20.Name = "btn_t20";
            btn_ct20.Height = 80;
            btn_ct20.Width = 100;
            btn_ct20.BorderThickness = new Thickness(0);
            btn_ct20.Background = new SolidColorBrush(Colors.Brown);
            btn_ct20.HorizontalAlignment = HorizontalAlignment.Center;
            btn_ct20.Margin = new Thickness(200, -80, 0, 0);
            btn_ct20.Click += new RoutedEventHandler(btn_ct20_Click);
            Button btn_bcl = new Button();
            btn_bcl.Content = "CL";
            btn_bcl.Name = "btn_cl";
            btn_bcl.Height = 80;
            btn_bcl.Width = 90;
            btn_bcl.BorderThickness = new Thickness(0);
            btn_bcl.Background = new SolidColorBrush(Colors.Brown);
            btn_bcl.HorizontalAlignment = HorizontalAlignment.Right;
            btn_bcl.Margin = new Thickness(10, -80, 0, 0);
            btn_bcl.Click += new RoutedEventHandler(btn_bcl_Click);
            stk.Children.Add(btn_cod);
            stk.Children.Add(btn_ctest);
            stk.Children.Add(btn_cipl);
            stk.Children.Add(btn_ct20);
            // stk.Children.Add(btn_bcl);
            items.Height = 480;
            items.Width = 400;


            TextBlock matches = new TextBlock();
            matches.Text = career_test.ElementAt(0).debuton;
            matches.FontSize = 24;
            matches.TextWrapping = TextWrapping.Wrap;
            matches.HorizontalAlignment = HorizontalAlignment.Right;
            matches.Foreground = new SolidColorBrush(Colors.Red);
            matches.Margin = new Thickness(255, -30, 0, 0);
            TextBlock matches_content = new TextBlock();
            matches_content.Text = "DEBUTON";
            matches_content.FontSize = 24;
            matches_content.Foreground = new SolidColorBrush(Colors.Red);
            matches_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_match = new StackPanel();
            stk_match.Height = 50;
            stk_match.Children.Add(matches_content);
            stk_match.Children.Add(matches);


            TextBlock innings = new TextBlock();
            innings.Text = career_test.ElementAt(0).debutagainst;
            innings.FontSize = 24;
            innings.TextWrapping = TextWrapping.Wrap;
            innings.HorizontalAlignment = HorizontalAlignment.Right;
            innings.Foreground = new SolidColorBrush(Colors.Blue);
            innings.Margin = new Thickness(255, -30, 0, 0);
            TextBlock innings_content = new TextBlock();
            innings_content.Text = "DEBUTAGAINST";
            innings_content.FontSize = 24;
            innings_content.Foreground = new SolidColorBrush(Colors.Blue);
            innings_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_inn = new StackPanel();
            stk_inn.Height = 50;
            stk_inn.Children.Add(innings_content);
            stk_inn.Children.Add(innings);

            TextBlock matchtype = new TextBlock();
            matchtype.Text = career_test.ElementAt(0).debutat;
            matchtype.TextWrapping = TextWrapping.Wrap;
            matchtype.FontSize = 24;
            matchtype.HorizontalAlignment = HorizontalAlignment.Right;
            matchtype.Foreground = new SolidColorBrush(Colors.Blue);
            matchtype.Margin = new Thickness(255, -30, 0, 0);
            TextBlock matchtype_content = new TextBlock();
            matchtype_content.Text = "DEBUTAT";
            matchtype_content.FontSize = 24;
            matchtype_content.HorizontalAlignment = HorizontalAlignment.Left;
            matchtype_content.Foreground = new SolidColorBrush(Colors.Blue);
            StackPanel stk_matchtype = new StackPanel();
            stk_matchtype.Height = 50;
            stk_matchtype.Children.Add(matchtype_content);
            stk_matchtype.Children.Add(matchtype);

            TextBlock notout = new TextBlock();
            notout.Text = career_test.ElementAt(0).lasttestplayedon;
            notout.FontSize = 24;
            notout.TextWrapping = TextWrapping.Wrap;
            notout.HorizontalAlignment = HorizontalAlignment.Right;
            notout.Foreground = new SolidColorBrush(Colors.Magenta);

            notout.Margin = new Thickness(255, -30, 0, 0);
            TextBlock notout_content = new TextBlock();
            notout_content.Text = "LAST ODIPLAYED ON";
            notout_content.FontSize = 24;
            notout_content.Foreground = new SolidColorBrush(Colors.Magenta);
            notout_content.HorizontalAlignment = HorizontalAlignment.Left;
            StackPanel stk_not = new StackPanel();
            stk_not.Height = 50;
            stk_not.Children.Add(notout_content);
            stk_not.Children.Add(notout);



            TextBlock runsscored = new TextBlock();
            runsscored.Text = career_test.ElementAt(0).lasttestplayedagainst;
            runsscored.FontSize = 24;
            runsscored.TextWrapping = TextWrapping.Wrap;
            runsscored.HorizontalAlignment = HorizontalAlignment.Right;
            runsscored.Foreground = new SolidColorBrush(Colors.Black);
            runsscored.Margin = new Thickness(280, -30, 0, 0);

            TextBlock runsscored_content = new TextBlock();
            runsscored_content.Text = "LAST PLAYED AGAINST";
            runsscored_content.FontSize = 24;
            runsscored_content.HorizontalAlignment = HorizontalAlignment.Left;
            runsscored_content.Foreground = new SolidColorBrush(Colors.Black);
            StackPanel stk_runs = new StackPanel();
            stk_runs.Height = 50;

            stk_runs.Children.Add(runsscored_content);
            stk_runs.Children.Add(runsscored);


            TextBlock highestscore = new TextBlock();
            highestscore.Text = career_test.ElementAt(0).lasttestplayeddat;
            highestscore.FontSize = 24;
            highestscore.TextWrapping = TextWrapping.Wrap;
            highestscore.Margin = new Thickness(280, -30, 0, 0);
            highestscore.HorizontalAlignment = HorizontalAlignment.Right;
            highestscore.Foreground = new SolidColorBrush(Colors.Purple);

            TextBlock highestscore_content = new TextBlock();
            highestscore_content.Text = "LAST PLAYED AT";
            highestscore_content.FontSize = 24;
            highestscore_content.HorizontalAlignment = HorizontalAlignment.Left;
            highestscore_content.Foreground = new SolidColorBrush(Colors.Purple);
            StackPanel stk_high = new StackPanel();
            stk_high.Height = 50;

            stk_high.Children.Add(highestscore_content);
            stk_high.Children.Add(highestscore);
            items.HorizontalAlignment = HorizontalAlignment.Center;
            items.Items.Add(stk_matchtype);
            items.Items.Add(stk_match);
            //    items.Items.Add(matches);
            items.Items.Add(stk_inn);
            //  items.Items.Add(matchtype);
            //   items.Items.Add(innings);

            items.Items.Add(stk_not);
            items.Items.Add(stk_runs);
            items.Items.Add(stk_high);
            //  items.Items.Add(stk_balls);
            //items.Items.Add(stk_six);

            //  items.Items.Add(runsscored);
            //  items.Items.Add(ballstaken);
            // items.Items.Add(sixes);
            //items.Items.Add(stk_four);
            // items.Items.Add(stk_fifty);
            // items.Items.Add(stk_ducks);
            // items.Items.Add(stk_catch);
            // items.Items.Add(stk_stumin);
            //   items.Items.Add(stk_hundr);
            // items.Items.Add(stk_aver);

            // items.Items.Add(fours);
            // items.Items.Add(ducks);
            // items.Items.Add(fifties);
            // items.Items.Add(catches);
            //  items.Items.Add(stumings);
            //  items.Items.Add(hundreds);
            //  items.Items.Add(average);
            stk.Children.Add(items);

            brc.Child = stk;
            career.Child = brc;
            career.IsOpen = true;
 
        }
    }
}